diff options
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 `-` +} |
