rust/tests/run-pass-fullmir/catch.rs
2018-08-30 15:57:17 +02:00

9 lines
215 B
Rust

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