diff options
Diffstat (limited to 'tests/ui/rfcs/rfc-2294-if-let-guard/macro-expanded.rs')
-rw-r--r-- | tests/ui/rfcs/rfc-2294-if-let-guard/macro-expanded.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/rfcs/rfc-2294-if-let-guard/macro-expanded.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/macro-expanded.rs new file mode 100644 index 000000000..423a2cd53 --- /dev/null +++ b/tests/ui/rfcs/rfc-2294-if-let-guard/macro-expanded.rs @@ -0,0 +1,16 @@ +// Expression macros can't expand to a let match guard. + +#![feature(if_let_guard)] +#![feature(let_chains)] + +macro_rules! m { + ($e:expr) => { let Some(x) = $e } + //~^ ERROR expected expression, found `let` statement +} + +fn main() { + match () { + () if m!(Some(5)) => {} + _ => {} + } +} |