summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-err4.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/consts/const-err4.rs')
-rw-r--r--src/test/ui/consts/const-err4.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/consts/const-err4.rs b/src/test/ui/consts/const-err4.rs
new file mode 100644
index 000000000..f0625faa8
--- /dev/null
+++ b/src/test/ui/consts/const-err4.rs
@@ -0,0 +1,15 @@
+// stderr-per-bitwidth
+#[derive(Copy, Clone)]
+union Foo {
+ a: isize,
+ b: (),
+}
+
+enum Bar {
+ Boo = [unsafe { Foo { b: () }.a }; 4][3],
+ //~^ ERROR it is undefined behavior to use this value
+}
+
+fn main() {
+ assert_ne!(Bar::Boo as isize, 0);
+}