mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 14:10:03 +03:00
ef52be031c
This also passes miri-test-libstd!
9 lines
241 B
Rust
9 lines
241 B
Rust
fn main() {
|
|
let target = &mut 42;
|
|
let target2 = target as *mut _;
|
|
drop(&mut *target); // reborrow
|
|
// Now make sure our ref is still the only one.
|
|
unsafe { *target2 = 13; } //~ ERROR borrow stack
|
|
let _val = *target;
|
|
}
|