]> git.proxmox.com Git - rustc.git/blob - src/tools/miri/tests/compile-fail/validation_recover2.rs
New upstream version 1.22.1+dfsg1
[rustc.git] / src / tools / miri / tests / compile-fail / validation_recover2.rs
1 #![allow(unused_variables)]
2
3 mod safe {
4 // This makes a ref that was passed to us via &mut alias with things it should not alias with
5 pub(crate) fn safe(x: &mut &u32, target: &mut u32) {
6 unsafe { *x = &mut *(target as *mut _); }
7 }
8 }
9
10 fn main() {
11 let target = &mut 42;
12 let mut target_alias = &42; // initial dummy value
13 safe::safe(&mut target_alias, target); //~ ERROR: in conflict with lock ReadLock
14 }