@@ -28,17 +28,37 @@ LL | let _: Ty<Ty2<u32, i32>> = core::mem::transmute(value::<Ty2<u32, f3
2828 |
2929 = note: two instances of the same generic type (`Ty2`) may have different layouts
3030
31- error: transmute to `&Ty2<u32, f32>` which has an undefined layout
31+ error: transmute from `Ty<&Ty2<u32, i32>>` to `&Ty2<u32, f32>`, both of which have an undefined layout
3232 --> $DIR/transmute_undefined_repr.rs:35:33
3333 |
3434LL | let _: &Ty2<u32, f32> = core::mem::transmute(value::<Ty<&Ty2<u32, i32>>>()); // Lint, different Ty2 instances
3535 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36+ |
37+ = note: two instances of the same generic type (`Ty2`) may have different layouts
3638
37- error: transmute from `&Ty2<u32, f32>` which has an undefined layout
39+ error: transmute from `&Ty2<u32, f32>` to `Ty<&Ty2<u32, i32>>`, both of which have an undefined layout
3840 --> $DIR/transmute_undefined_repr.rs:36:37
3941 |
4042LL | let _: Ty<&Ty2<u32, i32>> = core::mem::transmute(value::<&Ty2<u32, f32>>()); // Lint, different Ty2 instances
4143 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44+ |
45+ = note: two instances of the same generic type (`Ty2`) may have different layouts
46+
47+ error: transmute from `std::boxed::Box<Ty2<u32, u32>>` to `&mut Ty2<u32, f32>`, both of which have an undefined layout
48+ --> $DIR/transmute_undefined_repr.rs:56:45
49+ |
50+ LL | let _: &'static mut Ty2<u32, f32> = core::mem::transmute(value::<Box<Ty2<u32, u32>>>()); // Lint
51+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52+ |
53+ = note: two instances of the same generic type (`Ty2`) may have different layouts
54+
55+ error: transmute from `&mut Ty2<u32, f32>` to `std::boxed::Box<Ty2<u32, u32>>`, both of which have an undefined layout
56+ --> $DIR/transmute_undefined_repr.rs:58:37
57+ |
58+ LL | let _: Box<Ty2<u32, u32>> = core::mem::transmute(value::<&'static mut Ty2<u32, f32>>()); // Lint
59+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
60+ |
61+ = note: two instances of the same generic type (`Ty2`) may have different layouts
4262
43- error: aborting due to 6 previous errors
63+ error: aborting due to 8 previous errors
4464
0 commit comments