summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/try-with-nonterminal-block.rs
blob: 2a9652f2e6dcea80b9c2f503eff07e96897a54c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// check-pass
// edition:2021

#![feature(try_blocks)]

macro_rules! create_try {
    ($body:block) => {
        try $body
    };
}

fn main() {
    let x: Option<&str> = create_try! {{
        None?;
        "Hello world"
    }};

    println!("{x:?}");
}