2022-04-04 11:38:38 -05:00
|
|
|
error: casting the result of `i32::abs()` to u32
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:7:18
|
2022-04-04 11:38:38 -05:00
|
|
|
|
|
|
|
|
LL | let y: u32 = x.abs() as u32;
|
|
|
|
| ^^^^^^^^^^^^^^ help: replace with: `x.unsigned_abs()`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::cast-abs-to-unsigned` implied by `-D warnings`
|
|
|
|
|
2022-05-23 07:19:25 -05:00
|
|
|
error: casting the result of `i32::abs()` to usize
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:11:20
|
2022-05-23 07:19:25 -05:00
|
|
|
|
|
|
|
|
LL | let _: usize = a.abs() as usize;
|
|
|
|
| ^^^^^^^ help: replace with: `a.unsigned_abs()`
|
|
|
|
|
|
|
|
error: casting the result of `i32::abs()` to usize
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:12:20
|
2022-05-23 07:19:25 -05:00
|
|
|
|
|
|
|
|
LL | let _: usize = a.abs() as _;
|
|
|
|
| ^^^^^^^ help: replace with: `a.unsigned_abs()`
|
|
|
|
|
|
|
|
error: casting the result of `i32::abs()` to usize
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:13:13
|
2022-05-23 07:19:25 -05:00
|
|
|
|
|
|
|
|
LL | let _ = a.abs() as usize;
|
|
|
|
| ^^^^^^^ help: replace with: `a.unsigned_abs()`
|
|
|
|
|
|
|
|
error: casting the result of `i64::abs()` to usize
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:16:13
|
2022-05-23 07:19:25 -05:00
|
|
|
|
|
|
|
|
LL | let _ = a.abs() as usize;
|
|
|
|
| ^^^^^^^ help: replace with: `a.unsigned_abs()`
|
|
|
|
|
|
|
|
error: casting the result of `i64::abs()` to u8
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:17:13
|
2022-05-23 07:19:25 -05:00
|
|
|
|
|
|
|
|
LL | let _ = a.abs() as u8;
|
|
|
|
| ^^^^^^^ help: replace with: `a.unsigned_abs()`
|
|
|
|
|
|
|
|
error: casting the result of `i64::abs()` to u16
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:18:13
|
2022-05-23 07:19:25 -05:00
|
|
|
|
|
|
|
|
LL | let _ = a.abs() as u16;
|
|
|
|
| ^^^^^^^ help: replace with: `a.unsigned_abs()`
|
|
|
|
|
|
|
|
error: casting the result of `i64::abs()` to u32
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:19:13
|
2022-05-23 07:19:25 -05:00
|
|
|
|
|
|
|
|
LL | let _ = a.abs() as u32;
|
|
|
|
| ^^^^^^^ help: replace with: `a.unsigned_abs()`
|
|
|
|
|
|
|
|
error: casting the result of `i64::abs()` to u64
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:20:13
|
2022-05-23 07:19:25 -05:00
|
|
|
|
|
|
|
|
LL | let _ = a.abs() as u64;
|
|
|
|
| ^^^^^^^^^^^^^^ help: replace with: `a.unsigned_abs()`
|
|
|
|
|
|
|
|
error: casting the result of `i64::abs()` to u128
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:21:13
|
2022-05-23 07:19:25 -05:00
|
|
|
|
|
|
|
|
LL | let _ = a.abs() as u128;
|
|
|
|
| ^^^^^^^ help: replace with: `a.unsigned_abs()`
|
|
|
|
|
|
|
|
error: casting the result of `isize::abs()` to usize
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:24:13
|
2022-05-23 07:19:25 -05:00
|
|
|
|
|
|
|
|
LL | let _ = a.abs() as usize;
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: replace with: `a.unsigned_abs()`
|
|
|
|
|
|
|
|
error: casting the result of `isize::abs()` to u8
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:25:13
|
2022-05-23 07:19:25 -05:00
|
|
|
|
|
|
|
|
LL | let _ = a.abs() as u8;
|
|
|
|
| ^^^^^^^ help: replace with: `a.unsigned_abs()`
|
|
|
|
|
|
|
|
error: casting the result of `isize::abs()` to u16
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:26:13
|
2022-05-23 07:19:25 -05:00
|
|
|
|
|
|
|
|
LL | let _ = a.abs() as u16;
|
|
|
|
| ^^^^^^^ help: replace with: `a.unsigned_abs()`
|
|
|
|
|
|
|
|
error: casting the result of `isize::abs()` to u32
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:27:13
|
2022-05-23 07:19:25 -05:00
|
|
|
|
|
|
|
|
LL | let _ = a.abs() as u32;
|
|
|
|
| ^^^^^^^ help: replace with: `a.unsigned_abs()`
|
|
|
|
|
|
|
|
error: casting the result of `isize::abs()` to u64
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:28:13
|
2022-05-23 07:19:25 -05:00
|
|
|
|
|
|
|
|
LL | let _ = a.abs() as u64;
|
|
|
|
| ^^^^^^^ help: replace with: `a.unsigned_abs()`
|
|
|
|
|
|
|
|
error: casting the result of `isize::abs()` to u128
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:29:13
|
2022-05-23 07:19:25 -05:00
|
|
|
|
|
|
|
|
LL | let _ = a.abs() as u128;
|
|
|
|
| ^^^^^^^ help: replace with: `a.unsigned_abs()`
|
|
|
|
|
2022-07-30 09:21:37 -05:00
|
|
|
error: casting the result of `i64::abs()` to u32
|
2022-10-02 14:13:22 -05:00
|
|
|
--> $DIR/cast_abs_to_unsigned.rs:31:13
|
2022-07-30 09:21:37 -05:00
|
|
|
|
|
|
|
|
LL | let _ = (x as i64 - y as i64).abs() as u32;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(x as i64 - y as i64).unsigned_abs()`
|
|
|
|
|
|
|
|
error: aborting due to 17 previous errors
|
2022-04-04 11:38:38 -05:00
|
|
|
|