summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-bitshift-rhs-inference.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/consts/const-bitshift-rhs-inference.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/consts/const-bitshift-rhs-inference.rs b/src/test/ui/consts/const-bitshift-rhs-inference.rs
new file mode 100644
index 000000000..cf21c296c
--- /dev/null
+++ b/src/test/ui/consts/const-bitshift-rhs-inference.rs
@@ -0,0 +1,24 @@
+// run-pass
+const RHS: u8 = 8;
+const IRHS: i8 = 8;
+const RHS16: u16 = 8;
+const IRHS16: i16 = 8;
+const RHS32: u32 = 8;
+const IRHS32: i32 = 8;
+const RHS64: u64 = 8;
+const IRHS64: i64 = 8;
+const RHSUS: usize = 8;
+const IRHSIS: isize = 8;
+
+fn main() {
+ let _: [&'static str; 1 << RHS] = [""; 256];
+ let _: [&'static str; 1 << IRHS] = [""; 256];
+ let _: [&'static str; 1 << RHS16] = [""; 256];
+ let _: [&'static str; 1 << IRHS16] = [""; 256];
+ let _: [&'static str; 1 << RHS32] = [""; 256];
+ let _: [&'static str; 1 << IRHS32] = [""; 256];
+ let _: [&'static str; 1 << RHS64] = [""; 256];
+ let _: [&'static str; 1 << IRHS64] = [""; 256];
+ let _: [&'static str; 1 << RHSUS] = [""; 256];
+ let _: [&'static str; 1 << IRHSIS] = [""; 256];
+}