1 // normalize-stderr-test "\d+ bits" -> "N bits"
3 // Tests that are conservative around thin/fat pointer mismatches.
7 use std::mem::transmute;
9 fn a<T, U: ?Sized>(x: &[T]) -> &U {
10 unsafe { transmute(x) } //~ ERROR cannot transmute between types of different sizes
13 fn b<T: ?Sized, U: ?Sized>(x: &T) -> &U {
14 unsafe { transmute(x) } //~ ERROR cannot transmute between types of different sizes
17 fn c<T, U>(x: &T) -> &U {
18 unsafe { transmute(x) }
21 fn d<T, U>(x: &[T]) -> &[U] {
22 unsafe { transmute(x) }
25 fn e<T: ?Sized, U>(x: &T) -> &U {
26 unsafe { transmute(x) } //~ ERROR cannot transmute between types of different sizes
29 fn f<T, U: ?Sized>(x: &T) -> &U {
30 unsafe { transmute(x) } //~ ERROR cannot transmute between types of different sizes