2018-10-17 16:55:59 +02:00
|
|
|
fn main() {
|
|
|
|
let target = &mut 42;
|
|
|
|
let target2 = target as *mut _;
|
|
|
|
drop(&mut *target); // reborrow
|
2018-10-22 18:01:32 +02:00
|
|
|
// Now make sure our ref is still the only one.
|
2022-07-13 18:59:33 -04:00
|
|
|
unsafe { *target2 = 13 }; //~ ERROR: /write access .* tag does not exist in the borrow stack/
|
2018-10-22 18:01:32 +02:00
|
|
|
let _val = *target;
|
2018-10-17 16:55:59 +02:00
|
|
|
}
|