Closed
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),+
})