rust/tests/ui/macros/reparse-expr-issue-139495.rs
Nicholas Nethercote 6be270be0c Handle another negated literal in eat_token_lit.
Extends the change from #139653, which was on expressions, to literals.

Fixes #140098.
2025-04-22 15:08:32 +10:00

16 lines
271 B
Rust

macro_rules! m1 {
($abi: literal) => { extern $abi } //~ ERROR expected expression, found keyword `extern`
}
macro_rules! m2 {
($abi: expr) => { extern $abi } //~ ERROR expected expression, found keyword `extern`
}
fn main() {
m1!(-2)
}
fn f() {
m2!(-2)
}