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