diff options
Diffstat (limited to 'tests/ui/parser/trailing-question-in-macro-type.rs')
-rw-r--r-- | tests/ui/parser/trailing-question-in-macro-type.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/parser/trailing-question-in-macro-type.rs b/tests/ui/parser/trailing-question-in-macro-type.rs new file mode 100644 index 000000000..e2a681ddd --- /dev/null +++ b/tests/ui/parser/trailing-question-in-macro-type.rs @@ -0,0 +1,14 @@ +macro_rules! fn_expr { + ($return_type:ty : $body:expr) => { + (|| -> $return_type { $body })() + }; + ($body:expr) => { + (|| $body)() + }; +} + + +fn main() { + fn_expr!{ o?.when(|&i| i > 0)?.when(|&i| i%2 == 0) }; + //~^ ERROR cannot find value `o` in this scope +} |