Closed
Description
This is similar to the same buggy behavior we saw for $:ident
matchers fixed in 1.20.0.
For example in Rust 1.19 the following code fails to compile with the message "expected ident, found @"
, but correctly prints ident
followed by other
as of 1.20.
macro_rules! m {
($ident:ident) => { println!("ident"); };
($other:tt) => { println!("other"); };
}
fn main() {
m!(ident);
m!(@);
}
The $:lifetime
matcher is currently broken in the same way.
macro_rules! m {
($lifetime:lifetime) => { println!("lifetime"); };
($other:tt) => { println!("other"); };
}
fn main() {
m!('lifetime);
m!(@);
}
error: expected a lifetime, found `@`
--> src/main.rs:8:8
|
8 | m!(@);
| ^
rustc 1.28.0-nightly (2a00629 2018-06-09)