2018-05-09 08:54:45 -05:00
|
|
|
// ignore-test validation_op is disabled
|
|
|
|
|
2017-08-09 20:01:10 -05:00
|
|
|
#![allow(unused_variables)]
|
|
|
|
|
|
|
|
mod safe {
|
|
|
|
pub(crate) fn safe(x: &u32) {
|
|
|
|
let x : &mut u32 = unsafe { &mut *(x as *const _ as *mut _) };
|
|
|
|
*x = 42; //~ ERROR: in conflict with lock ReadLock
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let target = &mut 42;
|
|
|
|
let target_ref = ⌖
|
|
|
|
// do a reborrow, but we keep the lock
|
|
|
|
safe::safe(&*target);
|
|
|
|
}
|