Closed
Description
come here from rust-lang/rust#130853
here is simplified code, which can be successfully run by miri
fn main() {
let mut s = 0u8;
let borrow = &raw mut s;
unsafe {
let const_borrow: *const *mut u8 = &raw const borrow;
let x: &&u8 = &*const_borrow.cast::<&u8>();
let y1 = **x; // get the value from `&&u8`
*borrow = 1; // modify `s`
let y2 = **x; // and the value changed
assert!(y1 != y2);
}
}
Does this code conform to the alias model? Or miri has some issues with handling cast
?
Metadata
Metadata
Assignees
Labels
No labels