rust/tests/run-pass/catch.rs
2017-05-30 10:41:38 -07:00

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");
}
}