1 // This makes a ref that was passed to us via &mut alias with things it should not alias with
2 fn retarget(x: &mut &u32, target: &mut u32) {
3 unsafe { *x = &mut *(target as *mut _); }
8 let mut target_alias = &42; // initial dummy value
9 retarget(&mut target_alias, target);
10 // now `target_alias` points to the same thing as `target`
12 let _val = *target_alias; //~ ERROR borrow stack