-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTA-syntaxextArea: Syntax extensionsArea: Syntax extensionsI-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.
Description
This would allow doc comments to parse them as $_:meta
elements in macro invocations. This is useful for example with bitflags!
:
bitflags! {
#[doc = "Some flags"]
#[doc = ""]
#[doc = "A new line"]
#[deriving(Show)]
flags Flags: u32 {
#[doc = "Flag A"]
static FlagA = 0x00000001,
#[doc = "Flag B"]
static FlagB = 0x00000010
}
}
vs:
bitflags! {
/// Some flags
///
/// A new line
#[deriving(Show)]
flags Flags: u32 {
/// Flag A
static FlagA = 0x00000001,
/// Flag B
static FlagB = 0x00000010
}
}
Where the bitflags!
match rule is defined as:
($(#[$attr:meta])* flags $BitFlags:ident: $T:ty {
$($(#[$Flag_attr:meta])* static $Flag:ident = $value:expr),+
})
Metadata
Metadata
Assignees
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTA-syntaxextArea: Syntax extensionsArea: Syntax extensionsI-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.