about summary refs log tree commit diff
path: root/src/libstd/bitflags.rs
AgeCommit message (Collapse)AuthorLines
2014-05-05Add (unsafe) coercion from bits to std::bitflagsAaron Turon-0/+6
The intent of `std::bitflags` is to allow building type-safe wrappers around C-style flags APIs. But in addition to construction these flags from the Rust side, we need a way to convert them from the C side. This patch adds a `from_bits` function, which is unsafe since the bits in question may not represent a valid combination of flags.
2014-05-05Allow attributes in std::bitflags::bitflags!Aaron Turon-25/+40
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 } )
2014-05-01remove leftover obsolete string literalsDaniel Micay-1/+1
2014-04-30Update for language changesBrendan Zabarauskas-1/+1
2014-04-30Move bitflags module to libstdBrendan Zabarauskas-0/+257
This will allow us to provide type-safe APIs in libstd that are C-compatible.