diff options
| author | Kivooeo <Kivooeo123@gmail.com> | 2025-07-01 23:37:49 +0500 |
|---|---|---|
| committer | Kivooeo <Kivooeo123@gmail.com> | 2025-07-10 18:50:35 +0500 |
| commit | 259512e3b6a920b1e1eb6034fbc738e7b9815337 (patch) | |
| tree | c4c6b3982318b82036fd4d7d2b66885eb5ef814b /tests/ui/numbers-arithmetic | |
| parent | 1fb5e0149fb85af0e49fa40329cbc352b4cba861 (diff) | |
| download | rust-259512e3b6a920b1e1eb6034fbc738e7b9815337.tar.gz rust-259512e3b6a920b1e1eb6034fbc738e7b9815337.zip | |
cleaned up some tests
Diffstat (limited to 'tests/ui/numbers-arithmetic')
| -rw-r--r-- | tests/ui/numbers-arithmetic/unary-negation-unsigned-integer-error.rs | 2 | ||||
| -rw-r--r-- | tests/ui/numbers-arithmetic/unary-negation-unsigned-integer-error.stderr | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/tests/ui/numbers-arithmetic/unary-negation-unsigned-integer-error.rs b/tests/ui/numbers-arithmetic/unary-negation-unsigned-integer-error.rs index 943c7f79742..4325c8b111b 100644 --- a/tests/ui/numbers-arithmetic/unary-negation-unsigned-integer-error.rs +++ b/tests/ui/numbers-arithmetic/unary-negation-unsigned-integer-error.rs @@ -1,3 +1,5 @@ +//! This test ensures that the unary negation operator (`-`) cannot be applied to unsigned ints + fn main() { let x = -1 as usize; //~ ERROR: cannot apply unary operator `-` let x = (-1) as usize; //~ ERROR: cannot apply unary operator `-` diff --git a/tests/ui/numbers-arithmetic/unary-negation-unsigned-integer-error.stderr b/tests/ui/numbers-arithmetic/unary-negation-unsigned-integer-error.stderr index 0bedbc1accd..4ce870ded9f 100644 --- a/tests/ui/numbers-arithmetic/unary-negation-unsigned-integer-error.stderr +++ b/tests/ui/numbers-arithmetic/unary-negation-unsigned-integer-error.stderr @@ -1,5 +1,5 @@ error[E0600]: cannot apply unary operator `-` to type `usize` - --> $DIR/unsigned-literal-negation.rs:2:13 + --> $DIR/unary-negation-unsigned-integer-error.rs:4:13 | LL | let x = -1 as usize; | ^^ cannot apply unary operator `-` @@ -12,7 +12,7 @@ LL + let x = usize::MAX; | error[E0600]: cannot apply unary operator `-` to type `usize` - --> $DIR/unsigned-literal-negation.rs:3:13 + --> $DIR/unary-negation-unsigned-integer-error.rs:5:13 | LL | let x = (-1) as usize; | ^^^^ cannot apply unary operator `-` @@ -25,7 +25,7 @@ LL + let x = usize::MAX; | error[E0600]: cannot apply unary operator `-` to type `u32` - --> $DIR/unsigned-literal-negation.rs:4:18 + --> $DIR/unary-negation-unsigned-integer-error.rs:6:18 | LL | let x: u32 = -1; | ^^ cannot apply unary operator `-` |
