mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-14 01:25:54 +00:00
22 lines
338 B
Rust
22 lines
338 B
Rust
#![feature(catch_expr)]
|
|
|
|
fn main() {
|
|
let x = do catch { foo()? };
|
|
|
|
let x = do catch /* Invisible comment */ { foo()? };
|
|
|
|
let x = do catch { unsafe { foo()? } };
|
|
|
|
let y = match (do catch { foo()? }) {
|
|
_ => (),
|
|
};
|
|
|
|
do catch {
|
|
foo()?;
|
|
};
|
|
|
|
do catch {
|
|
// Regular do catch block
|
|
};
|
|
}
|