diff options
| author | Kivooeo <Kivooeo123@gmail.com> | 2025-07-01 23:33:59 +0500 |
|---|---|---|
| committer | Kivooeo <Kivooeo123@gmail.com> | 2025-07-01 23:33:59 +0500 |
| commit | 1fb5e0149fb85af0e49fa40329cbc352b4cba861 (patch) | |
| tree | 99717c06e20c4557a9e4d756a13bbf88d8093966 /tests/ui/numbers-arithmetic/unary-negation-unsigned-integer-error.rs | |
| parent | f46ce66fcc3d6058f90ac5bf0930f940f1e7b0ca (diff) | |
| download | rust-1fb5e0149fb85af0e49fa40329cbc352b4cba861.tar.gz rust-1fb5e0149fb85af0e49fa40329cbc352b4cba861.zip | |
moved tests
Diffstat (limited to 'tests/ui/numbers-arithmetic/unary-negation-unsigned-integer-error.rs')
| -rw-r--r-- | tests/ui/numbers-arithmetic/unary-negation-unsigned-integer-error.rs | 5 |
1 files changed, 5 insertions, 0 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 new file mode 100644 index 00000000000..943c7f79742 --- /dev/null +++ b/tests/ui/numbers-arithmetic/unary-negation-unsigned-integer-error.rs @@ -0,0 +1,5 @@ +fn main() { + let x = -1 as usize; //~ ERROR: cannot apply unary operator `-` + let x = (-1) as usize; //~ ERROR: cannot apply unary operator `-` + let x: u32 = -1; //~ ERROR: cannot apply unary operator `-` +} |
