summaryrefslogtreecommitdiffstats
path: root/tests/ui/regions/regions-infer-borrow-scope-view.rs
blob: 349b5204434d36fade220dd2e53438a0962e228c (plain)
1
2
3
4
5
6
7
8
9
10
11
// run-pass


fn view<T>(x: &[T]) -> &[T] {x}

pub fn main() {
    let v = vec![1, 2, 3];
    let x = view(&v);
    let y = view(x);
    assert!((v[0] == x[0]) && (v[0] == y[0]));
}