Files
rust/tests/ui/macros/attr-expr.rs
T
2026-03-20 18:48:38 -04:00

20 lines
378 B
Rust

macro_rules! foo {
($e:expr) => {
#[$e]
//~^ ERROR expected identifier, found metavariable
fn foo() {}
};
}
foo!(inline);
macro_rules! bar {
($e:expr) => {
#[inline($e)]
//~^ ERROR expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `expr` metavariable
fn bar() {}
};
}
bar!(always);
fn main() {}