summaryrefslogtreecommitdiffstats
path: root/tests/ui/regions/regions-dependent-autoslice.rs
blob: 4c5b35ec45590690fea940cc11777d59420a08cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// run-pass
// Test lifetimes are linked properly when we autoslice a vector.
// Issue #3148.

fn subslice1<'r>(v: &'r [usize]) -> &'r [usize] { v }

fn both<'r>(v: &'r [usize]) -> &'r [usize] {
    subslice1(subslice1(v))
}

pub fn main() {
    let v = vec![1,2,3];
    both(&v);
}