668491a892
Turns out that tracking write locks by their lifetime is not precise enough, but for now, we don't have an alternative. Also, we need to force_allocate what we acquire or else the memory will not be in the right state.
10 lines
192 B
Rust
10 lines
192 B
Rust
use std::panic::{catch_unwind, AssertUnwindSafe};
|
|
|
|
fn main() {
|
|
let mut i = 3;
|
|
let _ = catch_unwind(AssertUnwindSafe(|| {i -= 2;} ));
|
|
for _ in 0..i {
|
|
println!("I");
|
|
}
|
|
}
|