1 // Forbid assignment into a dynamically sized type.
3 #![feature(unsized_tuple_coercion)]
5 type Fat<T> = (isize, &'static str, T);
7 #[derive(PartialEq,Eq)]
10 #[derive(PartialEq,Eq)]
16 fn to_bar(&self) -> Bar;
17 fn to_val(&self) -> isize;
21 fn to_bar(&self) -> Bar {
24 fn to_val(&self) -> isize {
31 let f5: &mut Fat<dyn ToBar> = &mut (5, "some str", Bar1 {f :42});
32 let z: Box<dyn ToBar> = Box::new(Bar1 {f: 36});
34 //~^ ERROR mismatched types
35 //~| expected trait object `dyn ToBar`, found struct `Bar1`
36 //~| expected trait object `dyn ToBar`
37 //~| found struct `Bar1`
38 //~| ERROR the size for values of type