about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2014-05-02 09:41:34 -0700
committerAaron Turon <aturon@mozilla.com>2014-05-05 15:24:36 -0700
commitb733df0fc7942aea205d8fc451d2a4d17d47dfe9 (patch)
treec72580abfe9870fea2a9e5b3e5eb34c93df23599 /src/rustllvm/RustWrapper.cpp
parent600507d5380ca7d6d5536fabc2d4aca400c21bb9 (diff)
downloadrust-b733df0fc7942aea205d8fc451d2a4d17d47dfe9.tar.gz
rust-b733df0fc7942aea205d8fc451d2a4d17d47dfe9.zip
Allow attributes in std::bitflags::bitflags!
The `std::bitflags::bitflags!` macro did not provide support for
adding attributes to the generated structure or flags, due to
limitations in the parser for macros. This patch works around the
parser limitations by requiring a `flags` keyword in the overall
`bitflags!` invocation, and a `static` keyword for each flag:

    bitflags!(
        #[deriving(Hash)]
        #[doc="Three flags"]
        flags Flags: u32 {
            #[doc="The first flag"]
            static FlagA       = 0x00000001,
            static FlagB       = 0x00000010,
            static FlagC       = 0x00000100
        }
    )
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions