mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-30 14:52:56 +03:00
20 lines
378 B
Rust
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() {}
|