@@ -42,7 +42,7 @@ error: casting `f32` to `i32` may truncate the value
42
42
LL | 1f32 as i32;
43
43
| ^^^^^^^^^^^
44
44
|
45
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
45
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
46
46
= note: `-D clippy::cast-possible-truncation` implied by `-D warnings`
47
47
help: ... or use `try_from` and handle the error accordingly
48
48
|
@@ -55,7 +55,7 @@ error: casting `f32` to `u32` may truncate the value
55
55
LL | 1f32 as u32;
56
56
| ^^^^^^^^^^^
57
57
|
58
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
58
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
59
59
help: ... or use `try_from` and handle the error accordingly
60
60
|
61
61
LL | u32::try_from(1f32);
@@ -75,7 +75,7 @@ error: casting `f64` to `f32` may truncate the value
75
75
LL | 1f64 as f32;
76
76
| ^^^^^^^^^^^
77
77
|
78
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
78
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
79
79
help: ... or use `try_from` and handle the error accordingly
80
80
|
81
81
LL | f32::try_from(1f64);
@@ -87,7 +87,7 @@ error: casting `i32` to `i8` may truncate the value
87
87
LL | 1i32 as i8;
88
88
| ^^^^^^^^^^
89
89
|
90
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
90
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
91
91
help: ... or use `try_from` and handle the error accordingly
92
92
|
93
93
LL | i8::try_from(1i32);
@@ -99,7 +99,7 @@ error: casting `i32` to `u8` may truncate the value
99
99
LL | 1i32 as u8;
100
100
| ^^^^^^^^^^
101
101
|
102
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
102
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
103
103
help: ... or use `try_from` and handle the error accordingly
104
104
|
105
105
LL | u8::try_from(1i32);
@@ -111,7 +111,7 @@ error: casting `f64` to `isize` may truncate the value
111
111
LL | 1f64 as isize;
112
112
| ^^^^^^^^^^^^^
113
113
|
114
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
114
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
115
115
help: ... or use `try_from` and handle the error accordingly
116
116
|
117
117
LL | isize::try_from(1f64);
@@ -123,7 +123,7 @@ error: casting `f64` to `usize` may truncate the value
123
123
LL | 1f64 as usize;
124
124
| ^^^^^^^^^^^^^
125
125
|
126
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
126
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
127
127
help: ... or use `try_from` and handle the error accordingly
128
128
|
129
129
LL | usize::try_from(1f64);
@@ -141,7 +141,7 @@ error: casting `u32` to `u16` may truncate the value
141
141
LL | 1f32 as u32 as u16;
142
142
| ^^^^^^^^^^^^^^^^^^
143
143
|
144
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
144
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
145
145
help: ... or use `try_from` and handle the error accordingly
146
146
|
147
147
LL | u16::try_from(1f32 as u32);
@@ -153,7 +153,7 @@ error: casting `f32` to `u32` may truncate the value
153
153
LL | 1f32 as u32 as u16;
154
154
| ^^^^^^^^^^^
155
155
|
156
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
156
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
157
157
help: ... or use `try_from` and handle the error accordingly
158
158
|
159
159
LL | u32::try_from(1f32) as u16;
@@ -215,7 +215,7 @@ error: casting `i64` to `i8` may truncate the value
215
215
LL | (-99999999999i64).min(1) as i8; // should be linted because signed
216
216
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
217
217
|
218
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
218
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
219
219
help: ... or use `try_from` and handle the error accordingly
220
220
|
221
221
LL | i8::try_from((-99999999999i64).min(1)); // should be linted because signed
@@ -227,7 +227,7 @@ error: casting `u64` to `u8` may truncate the value
227
227
LL | 999999u64.clamp(0, 256) as u8; // should still be linted
228
228
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
229
229
|
230
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
230
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
231
231
help: ... or use `try_from` and handle the error accordingly
232
232
|
233
233
LL | u8::try_from(999999u64.clamp(0, 256)); // should still be linted
@@ -239,7 +239,7 @@ error: casting `main::E2` to `u8` may truncate the value
239
239
LL | let _ = self as u8;
240
240
| ^^^^^^^^^^
241
241
|
242
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
242
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
243
243
help: ... or use `try_from` and handle the error accordingly
244
244
|
245
245
LL | let _ = u8::try_from(self);
@@ -259,7 +259,7 @@ error: casting `main::E5` to `i8` may truncate the value
259
259
LL | let _ = self as i8;
260
260
| ^^^^^^^^^^
261
261
|
262
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
262
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
263
263
help: ... or use `try_from` and handle the error accordingly
264
264
|
265
265
LL | let _ = i8::try_from(self);
@@ -277,7 +277,7 @@ error: casting `main::E6` to `i16` may truncate the value
277
277
LL | let _ = self as i16;
278
278
| ^^^^^^^^^^^
279
279
|
280
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
280
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
281
281
help: ... or use `try_from` and handle the error accordingly
282
282
|
283
283
LL | let _ = i16::try_from(self);
@@ -289,7 +289,7 @@ error: casting `main::E7` to `usize` may truncate the value on targets with 32-b
289
289
LL | let _ = self as usize;
290
290
| ^^^^^^^^^^^^^
291
291
|
292
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
292
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
293
293
help: ... or use `try_from` and handle the error accordingly
294
294
|
295
295
LL | let _ = usize::try_from(self);
@@ -301,7 +301,7 @@ error: casting `main::E10` to `u16` may truncate the value
301
301
LL | let _ = self as u16;
302
302
| ^^^^^^^^^^^
303
303
|
304
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
304
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
305
305
help: ... or use `try_from` and handle the error accordingly
306
306
|
307
307
LL | let _ = u16::try_from(self);
@@ -313,7 +313,7 @@ error: casting `u32` to `u8` may truncate the value
313
313
LL | let c = (q >> 16) as u8;
314
314
| ^^^^^^^^^^^^^^^
315
315
|
316
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
316
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
317
317
help: ... or use `try_from` and handle the error accordingly
318
318
|
319
319
LL | let c = u8::try_from((q >> 16));
@@ -325,7 +325,7 @@ error: casting `u32` to `u8` may truncate the value
325
325
LL | let c = (q / 1000) as u8;
326
326
| ^^^^^^^^^^^^^^^^
327
327
|
328
- = help: if this is intentional allow the lint with `#[allow(clippy::cast_precision_loss )]` ...
328
+ = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation )]` ...
329
329
help: ... or use `try_from` and handle the error accordingly
330
330
|
331
331
LL | let c = u8::try_from((q / 1000));
0 commit comments