]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-28625.rs
Merge commit 'a8385522ade6f67853edac730b5bf164ddb298fd' into simd-remove-autosplats
[rust.git] / src / test / ui / issues / issue-28625.rs
1 // normalize-stderr-test "\d+ bits" -> "N bits"
2
3 trait Bar {
4     type Bar;
5 }
6
7 struct ArrayPeano<T: Bar> {
8     data: T::Bar,
9 }
10
11 fn foo<T>(a: &ArrayPeano<T>) -> &[T] where T: Bar {
12     unsafe { std::mem::transmute(a) } //~ ERROR cannot transmute between types of different sizes
13 }
14
15 impl Bar for () {
16     type Bar = ();
17 }
18
19 fn main() {
20     let x: ArrayPeano<()> = ArrayPeano { data: () };
21     foo(&x);
22 }