summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/transmute_undefined_repr.stderr
blob: e50a773290e17c60fe6a5bc839e0d009fe821650 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
error: transmute from `Ty2<u32, i32>` which has an undefined layout
  --> $DIR/transmute_undefined_repr.rs:28:33
   |
LL |         let _: Ty2C<u32, i32> = transmute(value::<Ty2<u32, i32>>()); // Lint, Ty2 is unordered
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `-D clippy::transmute-undefined-repr` implied by `-D warnings`

error: transmute into `Ty2<u32, i32>` which has an undefined layout
  --> $DIR/transmute_undefined_repr.rs:29:32
   |
LL |         let _: Ty2<u32, i32> = transmute(value::<Ty2C<u32, i32>>()); // Lint, Ty2 is unordered
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: transmute from `Ty<Ty2<u32, i32>>` to `Ty2<u32, f32>`, both of which have an undefined layout
  --> $DIR/transmute_undefined_repr.rs:34:32
   |
LL |         let _: Ty2<u32, f32> = transmute(value::<Ty<Ty2<u32, i32>>>()); // Lint, different Ty2 instances
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: two instances of the same generic type (`Ty2`) may have different layouts

error: transmute from `Ty2<u32, f32>` to `Ty<Ty2<u32, i32>>`, both of which have an undefined layout
  --> $DIR/transmute_undefined_repr.rs:35:36
   |
LL |         let _: Ty<Ty2<u32, i32>> = transmute(value::<Ty2<u32, f32>>()); // Lint, different Ty2 instances
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: two instances of the same generic type (`Ty2`) may have different layouts

error: transmute from `Ty<&Ty2<u32, i32>>` to `&Ty2<u32, f32>`, both of which have an undefined layout
  --> $DIR/transmute_undefined_repr.rs:40:33
   |
LL |         let _: &Ty2<u32, f32> = transmute(value::<Ty<&Ty2<u32, i32>>>()); // Lint, different Ty2 instances
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: two instances of the same generic type (`Ty2`) may have different layouts

error: transmute from `&Ty2<u32, f32>` to `Ty<&Ty2<u32, i32>>`, both of which have an undefined layout
  --> $DIR/transmute_undefined_repr.rs:41:37
   |
LL |         let _: Ty<&Ty2<u32, i32>> = transmute(value::<&Ty2<u32, f32>>()); // Lint, different Ty2 instances
   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: two instances of the same generic type (`Ty2`) may have different layouts

error: transmute from `std::boxed::Box<Ty2<u32, u32>>` to `&mut Ty2<u32, f32>`, both of which have an undefined layout
  --> $DIR/transmute_undefined_repr.rs:58:45
   |
LL |         let _: &'static mut Ty2<u32, f32> = transmute(value::<Box<Ty2<u32, u32>>>()); // Lint, different Ty2 instances
   |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: two instances of the same generic type (`Ty2`) may have different layouts

error: transmute from `&mut Ty2<u32, f32>` to `std::boxed::Box<Ty2<u32, u32>>`, both of which have an undefined layout
  --> $DIR/transmute_undefined_repr.rs:59:37
   |
LL |         let _: Box<Ty2<u32, u32>> = transmute(value::<&'static mut Ty2<u32, f32>>()); // Lint, different Ty2 instances
   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: two instances of the same generic type (`Ty2`) may have different layouts

error: transmute into `*const Ty2<u32, u32>` which has an undefined layout
  --> $DIR/transmute_undefined_repr.rs:119:39
   |
LL |         let _: *const Ty2<u32, u32> = transmute(value::<*const Ty2C<u32, Ty2<u32, u32>>>()); // Err
   |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the contained type `Ty2<u32, u32>` has an undefined layout

error: transmute from `*const Ty2<u32, u32>` which has an undefined layout
  --> $DIR/transmute_undefined_repr.rs:120:50
   |
LL |         let _: *const Ty2C<u32, Ty2<u32, u32>> = transmute(value::<*const Ty2<u32, u32>>()); // Err
   |                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the contained type `Ty2<u32, u32>` has an undefined layout

error: transmute from `std::vec::Vec<Ty2<U, i32>>` to `std::vec::Vec<Ty2<T, u32>>`, both of which have an undefined layout
  --> $DIR/transmute_undefined_repr.rs:150:35
   |
LL |         let _: Vec<Ty2<T, u32>> = transmute(value::<Vec<Ty2<U, i32>>>()); // Err
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: two instances of the same generic type (`Vec`) may have different layouts

error: transmute from `std::vec::Vec<Ty2<T, u32>>` to `std::vec::Vec<Ty2<U, i32>>`, both of which have an undefined layout
  --> $DIR/transmute_undefined_repr.rs:151:35
   |
LL |         let _: Vec<Ty2<U, i32>> = transmute(value::<Vec<Ty2<T, u32>>>()); // Err
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: two instances of the same generic type (`Vec`) may have different layouts

error: aborting due to 12 previous errors