Closed
Description
You can unfreeze with a temporary borrowed pointer, because it doesn't restore the previous state:
fn main() {
let x = @mut 5;
let a = &*x;
{
let b = &*x;
}
let c = &mut *x;
}
Mutable borrows aren't tracked:
fn main() {
let x = @mut 5;
let a = &mut *x;
let b = &mut *x;
let c = &*x;
}
I think freezing needs to be enum Borrow { Mutable, Immutable, Nothing }
with an immutable borrow failing if there was a Mutable one, and a mutable borrow failing on any freeze.
Metadata
Metadata
Assignees
Labels
No labels