rust/tests/ui/rfcs/rfc-2294-if-let-guard/macro-expanded.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
307 B
Rust
Raw Normal View History

2023-08-24 03:41:30 -05:00
// 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)) => {}
_ => {}
}
}