-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)Area: Declarative macros 2.0 (#39412)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
$:meta
is intended for matching the content of attributes, as in the following:
#![feature(decl_macro)]
macro m(
$(#[$m:meta])*
struct $n:ident;
) {
$(#[$m])*
struct $n(usize);
}
m! {
#[derive(Debug)]
struct S;
}
fn main() {
println!("{:?}", S(1));
}
According to #34981 (comment) we intend to support arbitrary token streams inside of attributes rather than the limited grammar of $:meta
. Let's have decl macros drop support for $:meta
and encourage #[$($meta:tt)*]
instead.
eddyb
Metadata
Metadata
Assignees
Labels
A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)Area: Declarative macros 2.0 (#39412)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.