1 // normalize-stderr-test "\d+ bits" -> "N bits"
3 // Tests that are conservative around thin/fat pointer mismatches.
7 use std::mem::transmute;
9 struct Foo<T: ?Sized> {
13 impl<T: ?Sized> Foo<T> {
14 fn m(x: &T) -> &isize where T : Sized {
15 // OK here, because T : Sized is in scope.
16 unsafe { transmute(x) }
19 fn n(x: &T) -> &isize {
20 // Not OK here, because T : Sized is not in scope.
21 unsafe { transmute(x) } //~ ERROR cannot transmute between types of different sizes