]> git.lizzy.rs Git - rust.git/blob - clippy_tests/examples/cast.stderr
Fix the test suite after cargo update
[rust.git] / clippy_tests / examples / cast.stderr
1 error: casting i32 to f32 causes a loss of precision (i32 is 32 bits wide, but f32's mantissa is only 23 bits wide)
2  --> cast.rs:8:5
3   |
4 8 |     1i32 as f32;
5   |     ^^^^^^^^^^^
6   |
7   = note: `-D cast-precision-loss` implied by `-D warnings`
8
9 error: casting i64 to f32 causes a loss of precision (i64 is 64 bits wide, but f32's mantissa is only 23 bits wide)
10  --> cast.rs:9:5
11   |
12 9 |     1i64 as f32;
13   |     ^^^^^^^^^^^
14   |
15   = note: `-D cast-precision-loss` implied by `-D warnings`
16
17 error: casting i64 to f64 causes a loss of precision (i64 is 64 bits wide, but f64's mantissa is only 52 bits wide)
18   --> cast.rs:10:5
19    |
20 10 |     1i64 as f64;
21    |     ^^^^^^^^^^^
22    |
23    = note: `-D cast-precision-loss` implied by `-D warnings`
24
25 error: casting u32 to f32 causes a loss of precision (u32 is 32 bits wide, but f32's mantissa is only 23 bits wide)
26   --> cast.rs:11:5
27    |
28 11 |     1u32 as f32;
29    |     ^^^^^^^^^^^
30    |
31    = note: `-D cast-precision-loss` implied by `-D warnings`
32
33 error: casting u64 to f32 causes a loss of precision (u64 is 64 bits wide, but f32's mantissa is only 23 bits wide)
34   --> cast.rs:12:5
35    |
36 12 |     1u64 as f32;
37    |     ^^^^^^^^^^^
38    |
39    = note: `-D cast-precision-loss` implied by `-D warnings`
40
41 error: casting u64 to f64 causes a loss of precision (u64 is 64 bits wide, but f64's mantissa is only 52 bits wide)
42   --> cast.rs:13:5
43    |
44 13 |     1u64 as f64;
45    |     ^^^^^^^^^^^
46    |
47    = note: `-D cast-precision-loss` implied by `-D warnings`
48
49 error: casting f32 to i32 may truncate the value
50   --> cast.rs:17:5
51    |
52 17 |     1f32 as i32;
53    |     ^^^^^^^^^^^
54    |
55    = note: `-D cast-possible-truncation` implied by `-D warnings`
56
57 error: casting f32 to u32 may truncate the value
58   --> cast.rs:18:5
59    |
60 18 |     1f32 as u32;
61    |     ^^^^^^^^^^^
62    |
63    = note: `-D cast-possible-truncation` implied by `-D warnings`
64
65 error: casting f32 to u32 may lose the sign of the value
66   --> cast.rs:18:5
67    |
68 18 |     1f32 as u32;
69    |     ^^^^^^^^^^^
70    |
71    = note: `-D cast-sign-loss` implied by `-D warnings`
72
73 error: casting f64 to f32 may truncate the value
74   --> cast.rs:19:5
75    |
76 19 |     1f64 as f32;
77    |     ^^^^^^^^^^^
78    |
79    = note: `-D cast-possible-truncation` implied by `-D warnings`
80
81 error: casting i32 to i8 may truncate the value
82   --> cast.rs:20:5
83    |
84 20 |     1i32 as i8;
85    |     ^^^^^^^^^^
86    |
87    = note: `-D cast-possible-truncation` implied by `-D warnings`
88
89 error: casting i32 to u8 may lose the sign of the value
90   --> cast.rs:21:5
91    |
92 21 |     1i32 as u8;
93    |     ^^^^^^^^^^
94    |
95    = note: `-D cast-sign-loss` implied by `-D warnings`
96
97 error: casting i32 to u8 may truncate the value
98   --> cast.rs:21:5
99    |
100 21 |     1i32 as u8;
101    |     ^^^^^^^^^^
102    |
103    = note: `-D cast-possible-truncation` implied by `-D warnings`
104
105 error: casting f64 to isize may truncate the value
106   --> cast.rs:22:5
107    |
108 22 |     1f64 as isize;
109    |     ^^^^^^^^^^^^^
110    |
111    = note: `-D cast-possible-truncation` implied by `-D warnings`
112
113 error: casting f64 to usize may truncate the value
114   --> cast.rs:23:5
115    |
116 23 |     1f64 as usize;
117    |     ^^^^^^^^^^^^^
118    |
119    = note: `-D cast-possible-truncation` implied by `-D warnings`
120
121 error: casting f64 to usize may lose the sign of the value
122   --> cast.rs:23:5
123    |
124 23 |     1f64 as usize;
125    |     ^^^^^^^^^^^^^
126    |
127    = note: `-D cast-sign-loss` implied by `-D warnings`
128
129 error: casting u8 to i8 may wrap around the value
130   --> cast.rs:25:5
131    |
132 25 |     1u8 as i8;
133    |     ^^^^^^^^^
134    |
135    = note: `-D cast-possible-wrap` implied by `-D warnings`
136
137 error: casting u16 to i16 may wrap around the value
138   --> cast.rs:26:5
139    |
140 26 |     1u16 as i16;
141    |     ^^^^^^^^^^^
142    |
143    = note: `-D cast-possible-wrap` implied by `-D warnings`
144
145 error: casting u32 to i32 may wrap around the value
146   --> cast.rs:27:5
147    |
148 27 |     1u32 as i32;
149    |     ^^^^^^^^^^^
150    |
151    = note: `-D cast-possible-wrap` implied by `-D warnings`
152
153 error: casting u64 to i64 may wrap around the value
154   --> cast.rs:28:5
155    |
156 28 |     1u64 as i64;
157    |     ^^^^^^^^^^^
158    |
159    = note: `-D cast-possible-wrap` implied by `-D warnings`
160
161 error: casting usize to isize may wrap around the value
162   --> cast.rs:29:5
163    |
164 29 |     1usize as isize;
165    |     ^^^^^^^^^^^^^^^
166    |
167    = note: `-D cast-possible-wrap` implied by `-D warnings`
168
169 error: casting i32 to u32 may lose the sign of the value
170   --> cast.rs:31:5
171    |
172 31 |     1i32 as u32;
173    |     ^^^^^^^^^^^
174    |
175    = note: `-D cast-sign-loss` implied by `-D warnings`
176
177 error: casting isize to usize may lose the sign of the value
178   --> cast.rs:32:5
179    |
180 32 |     1isize as usize;
181    |     ^^^^^^^^^^^^^^^
182    |
183    = note: `-D cast-sign-loss` implied by `-D warnings`
184
185 error: casting isize to i8 may truncate the value
186   --> cast.rs:35:5
187    |
188 35 |     1isize as i8;
189    |     ^^^^^^^^^^^^
190    |
191    = note: `-D cast-possible-truncation` implied by `-D warnings`
192
193 error: casting isize to f64 causes a loss of precision on targets with 64-bit wide pointers (isize is 64 bits wide, but f64's mantissa is only 52 bits wide)
194   --> cast.rs:36:5
195    |
196 36 |     1isize as f64;
197    |     ^^^^^^^^^^^^^
198    |
199    = note: `-D cast-precision-loss` implied by `-D warnings`
200
201 error: casting usize to f64 causes a loss of precision on targets with 64-bit wide pointers (usize is 64 bits wide, but f64's mantissa is only 52 bits wide)
202   --> cast.rs:37:5
203    |
204 37 |     1usize as f64;
205    |     ^^^^^^^^^^^^^
206    |
207    = note: `-D cast-precision-loss` implied by `-D warnings`
208
209 error: casting isize to f32 causes a loss of precision (isize is 32 or 64 bits wide, but f32's mantissa is only 23 bits wide)
210   --> cast.rs:38:5
211    |
212 38 |     1isize as f32;
213    |     ^^^^^^^^^^^^^
214    |
215    = note: `-D cast-precision-loss` implied by `-D warnings`
216
217 error: casting usize to f32 causes a loss of precision (usize is 32 or 64 bits wide, but f32's mantissa is only 23 bits wide)
218   --> cast.rs:39:5
219    |
220 39 |     1usize as f32;
221    |     ^^^^^^^^^^^^^
222    |
223    = note: `-D cast-precision-loss` implied by `-D warnings`
224
225 error: casting isize to i32 may truncate the value on targets with 64-bit wide pointers
226   --> cast.rs:40:5
227    |
228 40 |     1isize as i32;
229    |     ^^^^^^^^^^^^^
230    |
231    = note: `-D cast-possible-truncation` implied by `-D warnings`
232
233 error: casting isize to u32 may lose the sign of the value
234   --> cast.rs:41:5
235    |
236 41 |     1isize as u32;
237    |     ^^^^^^^^^^^^^
238    |
239    = note: `-D cast-sign-loss` implied by `-D warnings`
240
241 error: casting isize to u32 may truncate the value on targets with 64-bit wide pointers
242   --> cast.rs:41:5
243    |
244 41 |     1isize as u32;
245    |     ^^^^^^^^^^^^^
246    |
247    = note: `-D cast-possible-truncation` implied by `-D warnings`
248
249 error: casting usize to u32 may truncate the value on targets with 64-bit wide pointers
250   --> cast.rs:42:5
251    |
252 42 |     1usize as u32;
253    |     ^^^^^^^^^^^^^
254    |
255    = note: `-D cast-possible-truncation` implied by `-D warnings`
256
257 error: casting usize to i32 may truncate the value on targets with 64-bit wide pointers
258   --> cast.rs:43:5
259    |
260 43 |     1usize as i32;
261    |     ^^^^^^^^^^^^^
262    |
263    = note: `-D cast-possible-truncation` implied by `-D warnings`
264
265 error: casting usize to i32 may wrap around the value on targets with 32-bit wide pointers
266   --> cast.rs:43:5
267    |
268 43 |     1usize as i32;
269    |     ^^^^^^^^^^^^^
270    |
271    = note: `-D cast-possible-wrap` implied by `-D warnings`
272
273 error: casting i64 to isize may truncate the value on targets with 32-bit wide pointers
274   --> cast.rs:45:5
275    |
276 45 |     1i64 as isize;
277    |     ^^^^^^^^^^^^^
278    |
279    = note: `-D cast-possible-truncation` implied by `-D warnings`
280
281 error: casting i64 to usize may lose the sign of the value
282   --> cast.rs:46:5
283    |
284 46 |     1i64 as usize;
285    |     ^^^^^^^^^^^^^
286    |
287    = note: `-D cast-sign-loss` implied by `-D warnings`
288
289 error: casting i64 to usize may truncate the value on targets with 32-bit wide pointers
290   --> cast.rs:46:5
291    |
292 46 |     1i64 as usize;
293    |     ^^^^^^^^^^^^^
294    |
295    = note: `-D cast-possible-truncation` implied by `-D warnings`
296
297 error: casting u64 to isize may truncate the value on targets with 32-bit wide pointers
298   --> cast.rs:47:5
299    |
300 47 |     1u64 as isize;
301    |     ^^^^^^^^^^^^^
302    |
303    = note: `-D cast-possible-truncation` implied by `-D warnings`
304
305 error: casting u64 to isize may wrap around the value on targets with 64-bit wide pointers
306   --> cast.rs:47:5
307    |
308 47 |     1u64 as isize;
309    |     ^^^^^^^^^^^^^
310    |
311    = note: `-D cast-possible-wrap` implied by `-D warnings`
312
313 error: casting u64 to usize may truncate the value on targets with 32-bit wide pointers
314   --> cast.rs:48:5
315    |
316 48 |     1u64 as usize;
317    |     ^^^^^^^^^^^^^
318    |
319    = note: `-D cast-possible-truncation` implied by `-D warnings`
320
321 error: casting u32 to isize may wrap around the value on targets with 32-bit wide pointers
322   --> cast.rs:49:5
323    |
324 49 |     1u32 as isize;
325    |     ^^^^^^^^^^^^^
326    |
327    = note: `-D cast-possible-wrap` implied by `-D warnings`
328
329 error: casting i32 to usize may lose the sign of the value
330   --> cast.rs:52:5
331    |
332 52 |     1i32 as usize;
333    |     ^^^^^^^^^^^^^
334    |
335    = note: `-D cast-sign-loss` implied by `-D warnings`
336
337 error: casting to the same type is unnecessary (`i32` -> `i32`)
338   --> cast.rs:54:5
339    |
340 54 |     1i32 as i32;
341    |     ^^^^^^^^^^^
342    |
343    = note: `-D unnecessary-cast` implied by `-D warnings`
344
345 error: casting to the same type is unnecessary (`f32` -> `f32`)
346   --> cast.rs:55:5
347    |
348 55 |     1f32 as f32;
349    |     ^^^^^^^^^^^
350    |
351    = note: `-D unnecessary-cast` implied by `-D warnings`
352
353 error: casting to the same type is unnecessary (`bool` -> `bool`)
354   --> cast.rs:56:5
355    |
356 56 |     false as bool;
357    |     ^^^^^^^^^^^^^
358    |
359    = note: `-D unnecessary-cast` implied by `-D warnings`
360
361 error: aborting due to previous error(s)
362
363
364 To learn more, run the command again with --verbose.