about summary refs log tree commit diff
path: root/tests/source/catch.rs
blob: 64cc9e7a207974fa34d5bc12b4dbbd2218d5a303 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#![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
    };
}