1 // Attempt to change the mutability as well as unsizing.
3 struct Fat<T: ?Sized> {
12 // With a vec of ints.
13 let f1 = Fat { ptr: [1, 2, 3] };
14 let f2: &Fat<[isize; 3]> = &f1;
15 let f3: &mut Fat<[isize]> = f2; //~ ERROR mismatched types
18 let f1 = Fat { ptr: Foo };
19 let f2: &Fat<Foo> = &f1;
20 let f3: &mut Fat<dyn Bar> = f2; //~ ERROR mismatched types
22 // Tuple with a vec of ints.
23 let f1 = ([1, 2, 3],);
24 let f2: &([isize; 3],) = &f1;
25 let f3: &mut ([isize],) = f2; //~ ERROR mismatched types
27 // Tuple with a trait.
29 let f2: &(Foo,) = &f1;
30 let f3: &mut (dyn Bar,) = f2; //~ ERROR mismatched types