1 error: casting the result of `i32::abs()` to u32
2 --> $DIR/cast_abs_to_unsigned.rs:9:18
4 LL | let y: u32 = x.abs() as u32;
5 | ^^^^^^^^^^^^^^ help: replace with: `x.unsigned_abs()`
7 = note: `-D clippy::cast-abs-to-unsigned` implied by `-D warnings`
9 error: casting the result of `i32::abs()` to usize
10 --> $DIR/cast_abs_to_unsigned.rs:13:20
12 LL | let _: usize = a.abs() as usize;
13 | ^^^^^^^ help: replace with: `a.unsigned_abs()`
15 error: casting the result of `i32::abs()` to usize
16 --> $DIR/cast_abs_to_unsigned.rs:14:20
18 LL | let _: usize = a.abs() as _;
19 | ^^^^^^^ help: replace with: `a.unsigned_abs()`
21 error: casting the result of `i32::abs()` to usize
22 --> $DIR/cast_abs_to_unsigned.rs:15:13
24 LL | let _ = a.abs() as usize;
25 | ^^^^^^^ help: replace with: `a.unsigned_abs()`
27 error: casting the result of `i64::abs()` to usize
28 --> $DIR/cast_abs_to_unsigned.rs:18:13
30 LL | let _ = a.abs() as usize;
31 | ^^^^^^^ help: replace with: `a.unsigned_abs()`
33 error: casting the result of `i64::abs()` to u8
34 --> $DIR/cast_abs_to_unsigned.rs:19:13
36 LL | let _ = a.abs() as u8;
37 | ^^^^^^^ help: replace with: `a.unsigned_abs()`
39 error: casting the result of `i64::abs()` to u16
40 --> $DIR/cast_abs_to_unsigned.rs:20:13
42 LL | let _ = a.abs() as u16;
43 | ^^^^^^^ help: replace with: `a.unsigned_abs()`
45 error: casting the result of `i64::abs()` to u32
46 --> $DIR/cast_abs_to_unsigned.rs:21:13
48 LL | let _ = a.abs() as u32;
49 | ^^^^^^^ help: replace with: `a.unsigned_abs()`
51 error: casting the result of `i64::abs()` to u64
52 --> $DIR/cast_abs_to_unsigned.rs:22:13
54 LL | let _ = a.abs() as u64;
55 | ^^^^^^^^^^^^^^ help: replace with: `a.unsigned_abs()`
57 error: casting the result of `i64::abs()` to u128
58 --> $DIR/cast_abs_to_unsigned.rs:23:13
60 LL | let _ = a.abs() as u128;
61 | ^^^^^^^ help: replace with: `a.unsigned_abs()`
63 error: casting the result of `isize::abs()` to usize
64 --> $DIR/cast_abs_to_unsigned.rs:26:13
66 LL | let _ = a.abs() as usize;
67 | ^^^^^^^^^^^^^^^^ help: replace with: `a.unsigned_abs()`
69 error: casting the result of `isize::abs()` to u8
70 --> $DIR/cast_abs_to_unsigned.rs:27:13
72 LL | let _ = a.abs() as u8;
73 | ^^^^^^^ help: replace with: `a.unsigned_abs()`
75 error: casting the result of `isize::abs()` to u16
76 --> $DIR/cast_abs_to_unsigned.rs:28:13
78 LL | let _ = a.abs() as u16;
79 | ^^^^^^^ help: replace with: `a.unsigned_abs()`
81 error: casting the result of `isize::abs()` to u32
82 --> $DIR/cast_abs_to_unsigned.rs:29:13
84 LL | let _ = a.abs() as u32;
85 | ^^^^^^^ help: replace with: `a.unsigned_abs()`
87 error: casting the result of `isize::abs()` to u64
88 --> $DIR/cast_abs_to_unsigned.rs:30:13
90 LL | let _ = a.abs() as u64;
91 | ^^^^^^^ help: replace with: `a.unsigned_abs()`
93 error: casting the result of `isize::abs()` to u128
94 --> $DIR/cast_abs_to_unsigned.rs:31:13
96 LL | let _ = a.abs() as u128;
97 | ^^^^^^^ help: replace with: `a.unsigned_abs()`
99 error: casting the result of `i64::abs()` to u32
100 --> $DIR/cast_abs_to_unsigned.rs:33:13
102 LL | let _ = (x as i64 - y as i64).abs() as u32;
103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(x as i64 - y as i64).unsigned_abs()`
105 error: casting the result of `i32::abs()` to u32
106 --> $DIR/cast_abs_to_unsigned.rs:47:23
108 LL | assert_eq!(10u32, x.abs() as u32);
109 | ^^^^^^^^^^^^^^ help: replace with: `x.unsigned_abs()`
111 error: aborting due to 18 previous errors