1 // Test that we cannot create objects from unsized types.
3 trait Foo { fn foo(&self) {} }
7 fn test1<T: ?Sized + Foo>(t: &T) {
9 //~^ ERROR the size for values of type
12 fn test2<T: ?Sized + Foo>(t: &T) {
13 let v: &Foo = t as &Foo;
14 //~^ ERROR the size for values of type
18 let _: &[&Foo] = &["hi"];
19 //~^ ERROR the size for values of type
23 let _: &Foo = x as &Foo;
24 //~^ ERROR the size for values of type