|
1 | | -error: transmute from a type (`&T`) to itself |
2 | | - --> $DIR/transmute.rs:19:20 |
3 | | - | |
4 | | -LL | let _: &'a T = core::intrinsics::transmute(t); |
5 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
6 | | - | |
7 | | - = note: `-D clippy::useless-transmute` implied by `-D warnings` |
8 | | - |
9 | 1 | error: transmute from a reference to a pointer |
10 | | - --> $DIR/transmute.rs:23:23 |
| 2 | + --> $DIR/transmute.rs:24:23 |
11 | 3 | | |
12 | 4 | LL | let _: *const T = core::intrinsics::transmute(t); |
13 | 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t as *const T` |
| 6 | + | |
| 7 | + = note: `-D clippy::useless-transmute` implied by `-D warnings` |
14 | 8 |
|
15 | 9 | error: transmute from a reference to a pointer |
16 | | - --> $DIR/transmute.rs:25:21 |
| 10 | + --> $DIR/transmute.rs:26:21 |
17 | 11 | | |
18 | 12 | LL | let _: *mut T = core::intrinsics::transmute(t); |
19 | 13 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t as *const T as *mut T` |
20 | 14 |
|
21 | 15 | error: transmute from a reference to a pointer |
22 | | - --> $DIR/transmute.rs:27:23 |
| 16 | + --> $DIR/transmute.rs:28:23 |
23 | 17 | | |
24 | 18 | LL | let _: *const U = core::intrinsics::transmute(t); |
25 | 19 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t as *const T as *const U` |
26 | 20 |
|
27 | 21 | error: transmute from a type (`std::vec::Vec<i32>`) to itself |
28 | | - --> $DIR/transmute.rs:33:27 |
| 22 | + --> $DIR/transmute.rs:34:27 |
29 | 23 | | |
30 | 24 | LL | let _: Vec<i32> = core::intrinsics::transmute(my_vec()); |
31 | 25 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
32 | 26 |
|
33 | 27 | error: transmute from a type (`std::vec::Vec<i32>`) to itself |
34 | | - --> $DIR/transmute.rs:35:27 |
| 28 | + --> $DIR/transmute.rs:36:27 |
35 | 29 | | |
36 | 30 | LL | let _: Vec<i32> = core::mem::transmute(my_vec()); |
37 | 31 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
38 | 32 |
|
39 | 33 | error: transmute from a type (`std::vec::Vec<i32>`) to itself |
40 | | - --> $DIR/transmute.rs:37:27 |
| 34 | + --> $DIR/transmute.rs:38:27 |
41 | 35 | | |
42 | 36 | LL | let _: Vec<i32> = std::intrinsics::transmute(my_vec()); |
43 | 37 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
44 | 38 |
|
45 | 39 | error: transmute from a type (`std::vec::Vec<i32>`) to itself |
46 | | - --> $DIR/transmute.rs:39:27 |
| 40 | + --> $DIR/transmute.rs:40:27 |
47 | 41 | | |
48 | 42 | LL | let _: Vec<i32> = std::mem::transmute(my_vec()); |
49 | 43 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
50 | 44 |
|
51 | 45 | error: transmute from a type (`std::vec::Vec<i32>`) to itself |
52 | | - --> $DIR/transmute.rs:41:27 |
| 46 | + --> $DIR/transmute.rs:42:27 |
53 | 47 | | |
54 | 48 | LL | let _: Vec<i32> = my_transmute(my_vec()); |
55 | 49 | | ^^^^^^^^^^^^^^^^^^^^^^ |
56 | 50 |
|
57 | 51 | error: transmute from an integer to a pointer |
58 | | - --> $DIR/transmute.rs:43:31 |
| 52 | + --> $DIR/transmute.rs:44:31 |
59 | 53 | | |
60 | 54 | LL | let _: *const usize = std::mem::transmute(5_isize); |
61 | 55 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `5_isize as *const usize` |
62 | 56 |
|
63 | 57 | error: transmute from an integer to a pointer |
64 | | - --> $DIR/transmute.rs:47:31 |
| 58 | + --> $DIR/transmute.rs:48:31 |
65 | 59 | | |
66 | 60 | LL | let _: *const usize = std::mem::transmute(1 + 1usize); |
67 | 61 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(1 + 1usize) as *const usize` |
68 | 62 |
|
69 | 63 | error: transmute from a type (`*const Usize`) to the type that it points to (`Usize`) |
70 | | - --> $DIR/transmute.rs:62:24 |
| 64 | + --> $DIR/transmute.rs:79:24 |
71 | 65 | | |
72 | 66 | LL | let _: Usize = core::intrinsics::transmute(int_const_ptr); |
73 | 67 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
74 | 68 | | |
75 | 69 | = note: `-D clippy::crosspointer-transmute` implied by `-D warnings` |
76 | 70 |
|
77 | 71 | error: transmute from a type (`*mut Usize`) to the type that it points to (`Usize`) |
78 | | - --> $DIR/transmute.rs:64:24 |
| 72 | + --> $DIR/transmute.rs:81:24 |
79 | 73 | | |
80 | 74 | LL | let _: Usize = core::intrinsics::transmute(int_mut_ptr); |
81 | 75 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
82 | 76 |
|
83 | 77 | error: transmute from a type (`Usize`) to a pointer to that type (`*const Usize`) |
84 | | - --> $DIR/transmute.rs:66:31 |
| 78 | + --> $DIR/transmute.rs:83:31 |
85 | 79 | | |
86 | 80 | LL | let _: *const Usize = core::intrinsics::transmute(my_int()); |
87 | 81 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
88 | 82 |
|
89 | 83 | error: transmute from a type (`Usize`) to a pointer to that type (`*mut Usize`) |
90 | | - --> $DIR/transmute.rs:68:29 |
| 84 | + --> $DIR/transmute.rs:85:29 |
91 | 85 | | |
92 | 86 | LL | let _: *mut Usize = core::intrinsics::transmute(my_int()); |
93 | 87 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
94 | 88 |
|
95 | 89 | error: transmute from a `u32` to a `char` |
96 | | - --> $DIR/transmute.rs:74:28 |
| 90 | + --> $DIR/transmute.rs:91:28 |
97 | 91 | | |
98 | 92 | LL | let _: char = unsafe { std::mem::transmute(0_u32) }; |
99 | 93 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::char::from_u32(0_u32).unwrap()` |
100 | 94 | | |
101 | 95 | = note: `-D clippy::transmute-int-to-char` implied by `-D warnings` |
102 | 96 |
|
103 | 97 | error: transmute from a `i32` to a `char` |
104 | | - --> $DIR/transmute.rs:75:28 |
| 98 | + --> $DIR/transmute.rs:92:28 |
105 | 99 | | |
106 | 100 | LL | let _: char = unsafe { std::mem::transmute(0_i32) }; |
107 | 101 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::char::from_u32(0_i32 as u32).unwrap()` |
108 | 102 |
|
109 | 103 | error: transmute from a `u8` to a `bool` |
110 | | - --> $DIR/transmute.rs:84:28 |
| 104 | + --> $DIR/transmute.rs:101:28 |
111 | 105 | | |
112 | 106 | LL | let _: bool = unsafe { std::mem::transmute(0_u8) }; |
113 | 107 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `0_u8 != 0` |
114 | 108 | | |
115 | 109 | = note: `-D clippy::transmute-int-to-bool` implied by `-D warnings` |
116 | 110 |
|
117 | 111 | error: transmute from a `u32` to a `f32` |
118 | | - --> $DIR/transmute.rs:90:31 |
| 112 | + --> $DIR/transmute.rs:107:31 |
119 | 113 | | |
120 | 114 | LL | let _: f32 = unsafe { std::mem::transmute(0_u32) }; |
121 | 115 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f32::from_bits(0_u32)` |
122 | 116 | | |
123 | 117 | = note: `-D clippy::transmute-int-to-float` implied by `-D warnings` |
124 | 118 |
|
125 | 119 | error: transmute from a `i32` to a `f32` |
126 | | - --> $DIR/transmute.rs:91:31 |
| 120 | + --> $DIR/transmute.rs:108:31 |
127 | 121 | | |
128 | 122 | LL | let _: f32 = unsafe { std::mem::transmute(0_i32) }; |
129 | 123 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f32::from_bits(0_i32 as u32)` |
130 | 124 |
|
131 | 125 | error: transmute from a `u64` to a `f64` |
132 | | - --> $DIR/transmute.rs:92:31 |
| 126 | + --> $DIR/transmute.rs:109:31 |
133 | 127 | | |
134 | 128 | LL | let _: f64 = unsafe { std::mem::transmute(0_u64) }; |
135 | 129 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f64::from_bits(0_u64)` |
136 | 130 |
|
137 | 131 | error: transmute from a `i64` to a `f64` |
138 | | - --> $DIR/transmute.rs:93:31 |
| 132 | + --> $DIR/transmute.rs:110:31 |
139 | 133 | | |
140 | 134 | LL | let _: f64 = unsafe { std::mem::transmute(0_i64) }; |
141 | 135 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f64::from_bits(0_i64 as u64)` |
142 | 136 |
|
143 | 137 | error: transmute from a `u8` to a `[u8; 1]` |
144 | | - --> $DIR/transmute.rs:113:30 |
| 138 | + --> $DIR/transmute.rs:130:30 |
145 | 139 | | |
146 | 140 | LL | let _: [u8; 1] = std::mem::transmute(0u8); |
147 | 141 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u8.to_ne_bytes()` |
148 | 142 | | |
149 | 143 | = note: `-D clippy::transmute-num-to-bytes` implied by `-D warnings` |
150 | 144 |
|
151 | 145 | error: transmute from a `u32` to a `[u8; 4]` |
152 | | - --> $DIR/transmute.rs:114:30 |
| 146 | + --> $DIR/transmute.rs:131:30 |
153 | 147 | | |
154 | 148 | LL | let _: [u8; 4] = std::mem::transmute(0u32); |
155 | 149 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u32.to_ne_bytes()` |
156 | 150 |
|
157 | 151 | error: transmute from a `u128` to a `[u8; 16]` |
158 | | - --> $DIR/transmute.rs:115:31 |
| 152 | + --> $DIR/transmute.rs:132:31 |
159 | 153 | | |
160 | 154 | LL | let _: [u8; 16] = std::mem::transmute(0u128); |
161 | 155 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u128.to_ne_bytes()` |
162 | 156 |
|
163 | 157 | error: transmute from a `i8` to a `[u8; 1]` |
164 | | - --> $DIR/transmute.rs:116:30 |
| 158 | + --> $DIR/transmute.rs:133:30 |
165 | 159 | | |
166 | 160 | LL | let _: [u8; 1] = std::mem::transmute(0i8); |
167 | 161 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i8.to_ne_bytes()` |
168 | 162 |
|
169 | 163 | error: transmute from a `i32` to a `[u8; 4]` |
170 | | - --> $DIR/transmute.rs:117:30 |
| 164 | + --> $DIR/transmute.rs:134:30 |
171 | 165 | | |
172 | 166 | LL | let _: [u8; 4] = std::mem::transmute(0i32); |
173 | 167 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i32.to_ne_bytes()` |
174 | 168 |
|
175 | 169 | error: transmute from a `i128` to a `[u8; 16]` |
176 | | - --> $DIR/transmute.rs:118:31 |
| 170 | + --> $DIR/transmute.rs:135:31 |
177 | 171 | | |
178 | 172 | LL | let _: [u8; 16] = std::mem::transmute(0i128); |
179 | 173 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i128.to_ne_bytes()` |
180 | 174 |
|
181 | 175 | error: transmute from a `f32` to a `[u8; 4]` |
182 | | - --> $DIR/transmute.rs:119:30 |
| 176 | + --> $DIR/transmute.rs:136:30 |
183 | 177 | | |
184 | 178 | LL | let _: [u8; 4] = std::mem::transmute(0.0f32); |
185 | 179 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f32.to_ne_bytes()` |
186 | 180 |
|
187 | 181 | error: transmute from a `f64` to a `[u8; 8]` |
188 | | - --> $DIR/transmute.rs:120:30 |
| 182 | + --> $DIR/transmute.rs:137:30 |
189 | 183 | | |
190 | 184 | LL | let _: [u8; 8] = std::mem::transmute(0.0f64); |
191 | 185 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0.0f64.to_ne_bytes()` |
192 | 186 |
|
193 | 187 | error: transmute from a `u8` to a `[u8; 1]` |
194 | | - --> $DIR/transmute.rs:125:30 |
| 188 | + --> $DIR/transmute.rs:142:30 |
195 | 189 | | |
196 | 190 | LL | let _: [u8; 1] = std::mem::transmute(0u8); |
197 | 191 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u8.to_ne_bytes()` |
198 | 192 |
|
199 | 193 | error: transmute from a `u32` to a `[u8; 4]` |
200 | | - --> $DIR/transmute.rs:126:30 |
| 194 | + --> $DIR/transmute.rs:143:30 |
201 | 195 | | |
202 | 196 | LL | let _: [u8; 4] = std::mem::transmute(0u32); |
203 | 197 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u32.to_ne_bytes()` |
204 | 198 |
|
205 | 199 | error: transmute from a `u128` to a `[u8; 16]` |
206 | | - --> $DIR/transmute.rs:127:31 |
| 200 | + --> $DIR/transmute.rs:144:31 |
207 | 201 | | |
208 | 202 | LL | let _: [u8; 16] = std::mem::transmute(0u128); |
209 | 203 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0u128.to_ne_bytes()` |
210 | 204 |
|
211 | 205 | error: transmute from a `i8` to a `[u8; 1]` |
212 | | - --> $DIR/transmute.rs:128:30 |
| 206 | + --> $DIR/transmute.rs:145:30 |
213 | 207 | | |
214 | 208 | LL | let _: [u8; 1] = std::mem::transmute(0i8); |
215 | 209 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i8.to_ne_bytes()` |
216 | 210 |
|
217 | 211 | error: transmute from a `i32` to a `[u8; 4]` |
218 | | - --> $DIR/transmute.rs:129:30 |
| 212 | + --> $DIR/transmute.rs:146:30 |
219 | 213 | | |
220 | 214 | LL | let _: [u8; 4] = std::mem::transmute(0i32); |
221 | 215 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i32.to_ne_bytes()` |
222 | 216 |
|
223 | 217 | error: transmute from a `i128` to a `[u8; 16]` |
224 | | - --> $DIR/transmute.rs:130:31 |
| 218 | + --> $DIR/transmute.rs:147:31 |
225 | 219 | | |
226 | 220 | LL | let _: [u8; 16] = std::mem::transmute(0i128); |
227 | 221 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `0i128.to_ne_bytes()` |
228 | 222 |
|
229 | 223 | error: transmute from a `&[u8]` to a `&str` |
230 | | - --> $DIR/transmute.rs:140:28 |
| 224 | + --> $DIR/transmute.rs:157:28 |
231 | 225 | | |
232 | 226 | LL | let _: &str = unsafe { std::mem::transmute(B) }; |
233 | 227 | | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8(B).unwrap()` |
234 | 228 | | |
235 | 229 | = note: `-D clippy::transmute-bytes-to-str` implied by `-D warnings` |
236 | 230 |
|
237 | 231 | error: transmute from a `&mut [u8]` to a `&mut str` |
238 | | - --> $DIR/transmute.rs:141:32 |
| 232 | + --> $DIR/transmute.rs:158:32 |
239 | 233 | | |
240 | 234 | LL | let _: &mut str = unsafe { std::mem::transmute(mb) }; |
241 | 235 | | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_mut(mb).unwrap()` |
242 | 236 |
|
243 | 237 | error: transmute from a `&[u8]` to a `&str` |
244 | | - --> $DIR/transmute.rs:142:30 |
| 238 | + --> $DIR/transmute.rs:159:30 |
245 | 239 | | |
246 | 240 | LL | const _: &str = unsafe { std::mem::transmute(B) }; |
247 | 241 | | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_unchecked(B)` |
248 | 242 |
|
249 | | -error: aborting due to 39 previous errors |
| 243 | +error: aborting due to 38 previous errors |
250 | 244 |
|
0 commit comments