summaryrefslogtreecommitdiffstats
path: root/src/test/ui/numbers-arithmetic/unary-minus-suffix-inference.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/numbers-arithmetic/unary-minus-suffix-inference.rs')
-rw-r--r--src/test/ui/numbers-arithmetic/unary-minus-suffix-inference.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/ui/numbers-arithmetic/unary-minus-suffix-inference.rs b/src/test/ui/numbers-arithmetic/unary-minus-suffix-inference.rs
new file mode 100644
index 000000000..a4d0a8494
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/unary-minus-suffix-inference.rs
@@ -0,0 +1,23 @@
+// run-pass
+
+pub fn main() {
+ let a = 1;
+ let a_neg: i8 = -a;
+ println!("{}", a_neg);
+
+ let b = 1;
+ let b_neg: i16 = -b;
+ println!("{}", b_neg);
+
+ let c = 1;
+ let c_neg: i32 = -c;
+ println!("{}", c_neg);
+
+ let d = 1;
+ let d_neg: i64 = -d;
+ println!("{}", d_neg);
+
+ let e = 1;
+ let e_neg: isize = -e;
+ println!("{}", e_neg);
+}