2018-10-19 11:38:23 -05:00
|
|
|
fn main() {
|
|
|
|
let target = 42;
|
|
|
|
// Make sure raw ptr with raw tag cannot mutate frozen location without breaking the shared ref.
|
|
|
|
let r#ref = ⌖ // freeze
|
|
|
|
let ptr = r#ref as *const _ as *mut _; // raw ptr, with raw tag
|
2018-11-05 09:05:17 -06:00
|
|
|
unsafe { *ptr = 42; }
|
2018-11-09 03:53:28 -06:00
|
|
|
let _val = *r#ref; //~ ERROR is not frozen
|
2018-10-19 11:38:23 -05:00
|
|
|
}
|