#![feature(local_key_cell_methods)] #[macro_use] extern crate very_bad_error_propagation; struct Exception1; struct Exception2; struct Exception3; fn func1() -> u32 { throw!(Exception1); // 4 } fn func4() -> u32 { // throw!(Exception3); 4 } fn func2() -> u32 { catch!({ func4(); func1() }, { _x: Exception2 => { println!("caught 2"); 0 }, // _x: Exception3 => { // println!("caught 3"); // 0 // }, }) } fn func3() -> u32 { catch!(func2(), { _x: Exception1 => { println!("caught 1"); 0 }, }) } main! { println!("{}", func3()) }