1 // Attempt to extend the lifetime as well as unsizing.
3 #![feature(unsized_tuple_coercion)]
5 struct Fat<T: ?Sized> {
10 trait Bar { fn bar(&self) {} }
14 // With a vec of ints.
15 let f1 = Fat { ptr: [1, 2, 3] };
16 let f2: &Fat<[isize; 3]> = &f1; //~ ERROR `f1` does not live long enough
17 let f3: &'a Fat<[isize]> = f2;
20 let f1 = Fat { ptr: Foo };
21 let f2: &Fat<Foo> = &f1; //~ ERROR `f1` does not live long enough
22 let f3: &'a Fat<dyn Bar> = f2;
24 // Tuple with a vec of ints.
25 let f1 = ([1, 2, 3],);
26 let f2: &([isize; 3],) = &f1; //~ ERROR `f1` does not live long enough
27 let f3: &'a ([isize],) = f2;
29 // Tuple with a trait.
31 let f2: &(Foo,) = &f1; //~ ERROR `f1` does not live long enough
32 let f3: &'a (dyn Bar,) = f2;