]> git.lizzy.rs Git - rust.git/blob - tests/ui/regions/regions-dependent-autoslice.rs
internally change regions to be covariant
[rust.git] / tests / ui / regions / regions-dependent-autoslice.rs
1 // run-pass
2 // Test lifetimes are linked properly when we autoslice a vector.
3 // Issue #3148.
4
5 fn subslice1<'r>(v: &'r [usize]) -> &'r [usize] { v }
6
7 fn both<'r>(v: &'r [usize]) -> &'r [usize] {
8     subslice1(subslice1(v))
9 }
10
11 pub fn main() {
12     let v = vec![1,2,3];
13     both(&v);
14 }