rust/tests/run-pass-fullmir/catch.rs

9 lines
215 B
Rust
Raw Normal View History

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