rust/tests/compile-fail-fullmir/stacked_borrows/aliasing_mut2.rs
2018-11-16 10:01:54 +01:00

13 lines
253 B
Rust

// ignore-test validation_op is disabled
#![allow(unused_variables)]
mod safe {
pub fn safe(x: &i32, y: &mut i32) {} //~ ERROR: in conflict with lock ReadLock
}
fn main() {
let x = &mut 0 as *mut _;
unsafe { safe::safe(&*x, &mut *x) };
}