1 // Attempt to change the type as well as unsizing.
3 #![feature(unsized_tuple_coercion)]
5 struct Fat<T: ?Sized> {
10 trait Bar { fn bar(&self) {} }
13 // With a vec of isize.
14 let f1 = Fat { ptr: [1, 2, 3] };
15 let f2: &Fat<[isize; 3]> = &f1;
16 let f3: &Fat<[usize]> = f2;
17 //~^ ERROR mismatched types
20 let f1 = Fat { ptr: Foo };
21 let f2: &Fat<Foo> = &f1;
22 let f3: &Fat<dyn Bar> = f2;
23 //~^ ERROR `Foo: Bar` is not satisfied
25 // Tuple with a vec of isize.
26 let f1 = ([1, 2, 3],);
27 let f2: &([isize; 3],) = &f1;
28 let f3: &([usize],) = f2;
29 //~^ ERROR mismatched types
31 // Tuple with a trait.
33 let f2: &(Foo,) = &f1;
34 let f3: &(dyn Bar,) = f2;
35 //~^ ERROR `Foo: Bar` is not satisfied