Fix transmute intrinsic mir validation ICE
This commit is contained in:
parent
696aaad58c
commit
d8ed2fb0bb
2 changed files with 27 additions and 2 deletions
17
tests/ui/mir/validate/transmute_cast_sized.rs
Normal file
17
tests/ui/mir/validate/transmute_cast_sized.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// build-pass
|
||||
// compile-flags: -Zvalidate-mir
|
||||
// edition: 2021
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
// Use `PhantomData` to get target-independent size
|
||||
async fn get(_r: std::marker::PhantomData<&i32>) {
|
||||
loop {}
|
||||
}
|
||||
|
||||
pub fn check() {
|
||||
let mut v = get(loop {});
|
||||
let _ = || unsafe {
|
||||
v = std::mem::transmute([0_u8; 1]);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue