summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-points-to-static.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/consts/const-points-to-static.rs')
-rw-r--r--src/test/ui/consts/const-points-to-static.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/consts/const-points-to-static.rs b/src/test/ui/consts/const-points-to-static.rs
new file mode 100644
index 000000000..ca825a1f5
--- /dev/null
+++ b/src/test/ui/consts/const-points-to-static.rs
@@ -0,0 +1,13 @@
+// compile-flags: -Zunleash-the-miri-inside-of-you
+// stderr-per-bitwidth
+
+#![allow(dead_code)]
+
+const TEST: &u8 = &MY_STATIC;
+//~^ ERROR it is undefined behavior to use this value
+//~| encountered a reference pointing to a static variable
+
+static MY_STATIC: u8 = 4;
+
+fn main() {
+}