1 // Test implicit coercions involving DSTs and raw pointers.
7 struct Foo<T: ?Sized> {
12 // Test that we cannot convert from *-ptr to &S and &T
14 let y: &S = x; //~ ERROR mismatched types
15 let y: &dyn T = x; //~ ERROR mismatched types
17 // Test that we cannot convert from *-ptr to &S and &T (mut version)
18 let x: *mut S = &mut S;
19 let y: &S = x; //~ ERROR mismatched types
20 let y: &dyn T = x; //~ ERROR mismatched types
22 // Test that we cannot convert an immutable ptr to a mutable one using *-ptrs
23 let x: &mut dyn T = &S; //~ ERROR mismatched types
24 let x: *mut dyn T = &S; //~ ERROR mismatched types
25 let x: *mut S = &S; //~ ERROR mismatched types