about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-10-01 02:13:48 +0200
committerGitHub <noreply@github.com>2020-10-01 02:13:48 +0200
commitcc1513b860900f87a1077193f0a1dd4e1beeb577 (patch)
treefb545713633b4e35b4fd62ef703e09e9c12f49c4 /src
parentffb771bc7988ffb5ba862d2d794246ab0ede747d (diff)
parentce6c25da5887dcdb446b56892ace1d2463a743f3 (diff)
Rollup merge of #77360 - oli-obk:zst_const_pat_regression, r=RalfJung
References to ZSTs may be at arbitrary aligned addresses

fixes #77320

r? @RalfJung
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/match/const_non_normal_zst_ref_pattern.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/match/const_non_normal_zst_ref_pattern.rs b/src/test/ui/match/const_non_normal_zst_ref_pattern.rs
new file mode 100644
index 00000000000..a114fafb647
--- /dev/null
+++ b/src/test/ui/match/const_non_normal_zst_ref_pattern.rs
@@ -0,0 +1,9 @@
+// check-pass
+
+const FOO: isize = 10;
+const ZST: &() = unsafe { std::mem::transmute(FOO) };
+fn main() {
+    match &() {
+        ZST => 9,
+    };
+}