From ce6c25da5887dcdb446b56892ace1d2463a743f3 Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Wed, 30 Sep 2020 10:40:49 +0200 Subject: References to ZSTs may be at arbitrary aligned addresses --- src/test/ui/match/const_non_normal_zst_ref_pattern.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/test/ui/match/const_non_normal_zst_ref_pattern.rs (limited to 'src') 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, + }; +} -- cgit 1.4.1-3-g733a5