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
This commit is contained in:
commit
cc1513b860
2 changed files with 14 additions and 5 deletions
9
src/test/ui/match/const_non_normal_zst_ref_pattern.rs
Normal file
9
src/test/ui/match/const_non_normal_zst_ref_pattern.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// check-pass
|
||||
|
||||
const FOO: isize = 10;
|
||||
const ZST: &() = unsafe { std::mem::transmute(FOO) };
|
||||
fn main() {
|
||||
match &() {
|
||||
ZST => 9,
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue