1 use std::alloc::{alloc, Layout};
3 fn inner(x: *mut i32, _y: &i32) {
4 // If `x` and `y` alias, retagging is fine with this... but we really
5 // shouldn't be allowed to write to `x` at all because `y` was assumed to be
6 // immutable for the duration of this call.
7 unsafe { *x = 0 }; //~ ERROR: protect
12 let ptr = alloc(Layout::for_value(&0i32)) as *mut i32;