diff options
Diffstat (limited to 'tests/ui/parser/try-with-nonterminal-block.rs')
-rw-r--r-- | tests/ui/parser/try-with-nonterminal-block.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/parser/try-with-nonterminal-block.rs b/tests/ui/parser/try-with-nonterminal-block.rs new file mode 100644 index 000000000..2a9652f2e --- /dev/null +++ b/tests/ui/parser/try-with-nonterminal-block.rs @@ -0,0 +1,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:?}"); +} |