2018-10-22 11:01:32 -05:00
|
|
|
fn main() {
|
|
|
|
let mut x = 0;
|
|
|
|
let y: *const i32 = &x;
|
|
|
|
x = 1; // this invalidates y by reactivating the lowermost uniq borrow for this local
|
|
|
|
|
2019-02-12 03:51:03 -06:00
|
|
|
assert_eq!(unsafe { *y }, 1); //~ ERROR does not exist on the borrow stack
|
2018-10-22 11:01:32 -05:00
|
|
|
|
|
|
|
assert_eq!(x, 1);
|
|
|
|
}
|