I's going through the examples for shared references here and found that replacing let ptr4 = sref3 as *mut i32; with let ptr4 = sref3 as *const i32 as *mut i32; doesn't work even without miri on
stable-x86_64-unknown-linux-gnu (default)
rustc 1.75.0 (82e1608df 2023-12-21)
cargo run gives the following:
error: assigning to `&T` is undefined behavior, consider using an `UnsafeCell`
I'm not sure if I just messed-up something locally or it's a new stable safety feature.