]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/catch.rs
Merge commit '39683d8eb7a32a74bea96ecbf1e87675d3338506' into sync_cg_gcc-2022-03-26
[rust.git] / src / tools / rustfmt / tests / target / catch.rs
1 // rustfmt-edition: 2018
2 #![feature(try_blocks)]
3
4 fn main() {
5     let x = try { foo()? };
6
7     let x = try /* Invisible comment */ { foo()? };
8
9     let x = try { unsafe { foo()? } };
10
11     let y = match (try { foo()? }) {
12         _ => (),
13     };
14
15     try {
16         foo()?;
17     };
18
19     try {
20         // Regular try block
21     };
22 }