Files
rust/tests/ui/attributes/nonterminal-expansion.rs

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

20 lines
423 B
Rust
Raw Normal View History

//@ compile-flags: -Zdeduplicate-diagnostics=yes
// Macros were previously expanded in `Expr` nonterminal tokens, now they are not.
macro_rules! pass_nonterminal {
($n:expr) => {
#[repr(align($n))]
2025-07-31 15:38:44 +02:00
//~^ ERROR expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `expr` metavariable
struct S;
};
}
macro_rules! n {
() => { 32 };
}
pass_nonterminal!(n!());
fn main() {}