rust/tests/run-pass-fullmir/catch.rs
2018-11-26 15:31:53 +01:00

9 lines
218 B
Rust

//ignore-msvc: Stdout not implemented on Windows
use std::panic::{catch_unwind, AssertUnwindSafe};
fn main() {
let mut i = 3;
let _val = catch_unwind(AssertUnwindSafe(|| {i -= 2;} ));
println!("{}", i);
}