@@ -28,17 +28,37 @@ LL | let _: Ty<Ty2<u32, i32>> = core::mem::transmute(value::<Ty2<u32, f3
28
28
|
29
29
= note: two instances of the same generic type (`Ty2`) may have different layouts
30
30
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
32
32
--> $DIR/transmute_undefined_repr.rs:35:33
33
33
|
34
34
LL | let _: &Ty2<u32, f32> = core::mem::transmute(value::<Ty<&Ty2<u32, i32>>>()); // Lint, different Ty2 instances
35
35
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36
+ |
37
+ = note: two instances of the same generic type (`Ty2`) may have different layouts
36
38
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
38
40
--> $DIR/transmute_undefined_repr.rs:36:37
39
41
|
40
42
LL | let _: Ty<&Ty2<u32, i32>> = core::mem::transmute(value::<&Ty2<u32, f32>>()); // Lint, different Ty2 instances
41
43
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
42
62
43
- error: aborting due to 6 previous errors
63
+ error: aborting due to 8 previous errors
44
64
0 commit comments