]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/transmute_undefined_repr.stderr
make const_err a hard error
[rust.git] / src / tools / clippy / tests / ui / transmute_undefined_repr.stderr
1 error: transmute from `Ty2<u32, i32>` which has an undefined layout
2   --> $DIR/transmute_undefined_repr.rs:28:33
3    |
4 LL |         let _: Ty2C<u32, i32> = transmute(value::<Ty2<u32, i32>>()); // Lint, Ty2 is unordered
5    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: `-D clippy::transmute-undefined-repr` implied by `-D warnings`
8
9 error: transmute into `Ty2<u32, i32>` which has an undefined layout
10   --> $DIR/transmute_undefined_repr.rs:29:32
11    |
12 LL |         let _: Ty2<u32, i32> = transmute(value::<Ty2C<u32, i32>>()); // Lint, Ty2 is unordered
13    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14
15 error: transmute from `Ty<Ty2<u32, i32>>` to `Ty2<u32, f32>`, both of which have an undefined layout
16   --> $DIR/transmute_undefined_repr.rs:34:32
17    |
18 LL |         let _: Ty2<u32, f32> = transmute(value::<Ty<Ty2<u32, i32>>>()); // Lint, different Ty2 instances
19    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20    |
21    = note: two instances of the same generic type (`Ty2`) may have different layouts
22
23 error: transmute from `Ty2<u32, f32>` to `Ty<Ty2<u32, i32>>`, both of which have an undefined layout
24   --> $DIR/transmute_undefined_repr.rs:35:36
25    |
26 LL |         let _: Ty<Ty2<u32, i32>> = transmute(value::<Ty2<u32, f32>>()); // Lint, different Ty2 instances
27    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28    |
29    = note: two instances of the same generic type (`Ty2`) may have different layouts
30
31 error: transmute from `Ty<&Ty2<u32, i32>>` to `&Ty2<u32, f32>`, both of which have an undefined layout
32   --> $DIR/transmute_undefined_repr.rs:40:33
33    |
34 LL |         let _: &Ty2<u32, f32> = transmute(value::<Ty<&Ty2<u32, i32>>>()); // Lint, different Ty2 instances
35    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36    |
37    = note: two instances of the same generic type (`Ty2`) may have different layouts
38
39 error: transmute from `&Ty2<u32, f32>` to `Ty<&Ty2<u32, i32>>`, both of which have an undefined layout
40   --> $DIR/transmute_undefined_repr.rs:41:37
41    |
42 LL |         let _: Ty<&Ty2<u32, i32>> = transmute(value::<&Ty2<u32, f32>>()); // Lint, different Ty2 instances
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:58:45
49    |
50 LL |         let _: &'static mut Ty2<u32, f32> = transmute(value::<Box<Ty2<u32, u32>>>()); // Lint, different Ty2 instances
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:59:37
57    |
58 LL |         let _: Box<Ty2<u32, u32>> = transmute(value::<&'static mut Ty2<u32, f32>>()); // Lint, different Ty2 instances
59    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
60    |
61    = note: two instances of the same generic type (`Ty2`) may have different layouts
62
63 error: transmute into `*const Ty2<u32, u32>` which has an undefined layout
64   --> $DIR/transmute_undefined_repr.rs:119:39
65    |
66 LL |         let _: *const Ty2<u32, u32> = transmute(value::<*const Ty2C<u32, Ty2<u32, u32>>>()); // Err
67    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68    |
69    = note: the contained type `Ty2<u32, u32>` has an undefined layout
70
71 error: transmute from `*const Ty2<u32, u32>` which has an undefined layout
72   --> $DIR/transmute_undefined_repr.rs:120:50
73    |
74 LL |         let _: *const Ty2C<u32, Ty2<u32, u32>> = transmute(value::<*const Ty2<u32, u32>>()); // Err
75    |                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76    |
77    = note: the contained type `Ty2<u32, u32>` has an undefined layout
78
79 error: transmute from `std::vec::Vec<Ty2<U, i32>>` to `std::vec::Vec<Ty2<T, u32>>`, both of which have an undefined layout
80   --> $DIR/transmute_undefined_repr.rs:150:35
81    |
82 LL |         let _: Vec<Ty2<T, u32>> = transmute(value::<Vec<Ty2<U, i32>>>()); // Err
83    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84    |
85    = note: two instances of the same generic type (`Vec`) may have different layouts
86
87 error: transmute from `std::vec::Vec<Ty2<T, u32>>` to `std::vec::Vec<Ty2<U, i32>>`, both of which have an undefined layout
88   --> $DIR/transmute_undefined_repr.rs:151:35
89    |
90 LL |         let _: Vec<Ty2<U, i32>> = transmute(value::<Vec<Ty2<T, u32>>>()); // Err
91    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92    |
93    = note: two instances of the same generic type (`Vec`) may have different layouts
94
95 error: aborting due to 12 previous errors
96