rust/tests/target/catch.rs

23 lines
328 B
Rust
Raw Normal View History

// rustfmt-edition: 2018
#![feature(try_blocks)]
2017-05-12 17:28:48 -05:00
fn main() {
let x = try { foo()? };
2017-05-12 17:28:48 -05:00
let x = try /* Invisible comment */ { foo()? };
2017-05-12 17:28:48 -05:00
let x = try { unsafe { foo()? } };
2017-05-12 17:28:48 -05:00
let y = match (try { foo()? }) {
2017-05-12 17:28:48 -05:00
_ => (),
};
try {
2017-05-12 17:28:48 -05:00
foo()?;
};
try {
// Regular try block
2017-05-12 17:28:48 -05:00
};
}