summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/catch.rs
blob: ffe694f8e7252cd64330e7d1626c0a94e5f03ff2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// rustfmt-edition: 2018
#![feature(try_blocks)]

fn main() {
    let x = try { foo()? };

    let x = try /* Invisible comment */ { foo()? };

    let x = try { unsafe { foo()? } };

    let y = match (try { foo()? }) {
        _ => (),
    };

    try {
        foo()?;
    };

    try {
        // Regular try block
    };
}