Files
rust/tests/ui/parser/attribute/attr-bad-meta-4.rs

16 lines
375 B
Rust
Raw Normal View History

macro_rules! mac {
($attr_item: meta) => {
#[cfg($attr_item)]
2025-07-31 15:38:44 +02:00
//~^ ERROR expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `meta` metavariable
struct S;
}
}
mac!(an(arbitrary token stream));
2024-05-06 01:25:49 +02:00
#[cfg(feature = -1)]
2025-07-31 15:38:44 +02:00
//~^ ERROR expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `-`
2024-05-06 01:25:49 +02:00
fn handler() {}
fn main() {}