summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/cast_abs_to_unsigned.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/tools/clippy/tests/ui/cast_abs_to_unsigned.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/cast_abs_to_unsigned.stderr')
-rw-r--r--src/tools/clippy/tests/ui/cast_abs_to_unsigned.stderr100
1 files changed, 100 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/cast_abs_to_unsigned.stderr b/src/tools/clippy/tests/ui/cast_abs_to_unsigned.stderr
new file mode 100644
index 000000000..02c24e106
--- /dev/null
+++ b/src/tools/clippy/tests/ui/cast_abs_to_unsigned.stderr
@@ -0,0 +1,100 @@
+error: casting the result of `i32::abs()` to u32
+ --> $DIR/cast_abs_to_unsigned.rs:6:18
+ |
+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`
+
+error: casting the result of `i32::abs()` to usize
+ --> $DIR/cast_abs_to_unsigned.rs:10:20
+ |
+LL | let _: usize = a.abs() as usize;
+ | ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `i32::abs()` to usize
+ --> $DIR/cast_abs_to_unsigned.rs:11:20
+ |
+LL | let _: usize = a.abs() as _;
+ | ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `i32::abs()` to usize
+ --> $DIR/cast_abs_to_unsigned.rs:12:13
+ |
+LL | let _ = a.abs() as usize;
+ | ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `i64::abs()` to usize
+ --> $DIR/cast_abs_to_unsigned.rs:15:13
+ |
+LL | let _ = a.abs() as usize;
+ | ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `i64::abs()` to u8
+ --> $DIR/cast_abs_to_unsigned.rs:16:13
+ |
+LL | let _ = a.abs() as u8;
+ | ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `i64::abs()` to u16
+ --> $DIR/cast_abs_to_unsigned.rs:17:13
+ |
+LL | let _ = a.abs() as u16;
+ | ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `i64::abs()` to u32
+ --> $DIR/cast_abs_to_unsigned.rs:18:13
+ |
+LL | let _ = a.abs() as u32;
+ | ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `i64::abs()` to u64
+ --> $DIR/cast_abs_to_unsigned.rs:19:13
+ |
+LL | let _ = a.abs() as u64;
+ | ^^^^^^^^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `i64::abs()` to u128
+ --> $DIR/cast_abs_to_unsigned.rs:20:13
+ |
+LL | let _ = a.abs() as u128;
+ | ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `isize::abs()` to usize
+ --> $DIR/cast_abs_to_unsigned.rs:23:13
+ |
+LL | let _ = a.abs() as usize;
+ | ^^^^^^^^^^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `isize::abs()` to u8
+ --> $DIR/cast_abs_to_unsigned.rs:24:13
+ |
+LL | let _ = a.abs() as u8;
+ | ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `isize::abs()` to u16
+ --> $DIR/cast_abs_to_unsigned.rs:25:13
+ |
+LL | let _ = a.abs() as u16;
+ | ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `isize::abs()` to u32
+ --> $DIR/cast_abs_to_unsigned.rs:26:13
+ |
+LL | let _ = a.abs() as u32;
+ | ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `isize::abs()` to u64
+ --> $DIR/cast_abs_to_unsigned.rs:27:13
+ |
+LL | let _ = a.abs() as u64;
+ | ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: casting the result of `isize::abs()` to u128
+ --> $DIR/cast_abs_to_unsigned.rs:28:13
+ |
+LL | let _ = a.abs() as u128;
+ | ^^^^^^^ help: replace with: `a.unsigned_abs()`
+
+error: aborting due to 16 previous errors
+