diff options
Diffstat (limited to 'src/libstd/bitflags.rs')
| -rw-r--r-- | src/libstd/bitflags.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libstd/bitflags.rs b/src/libstd/bitflags.rs index 8a90c06f038..ffcd6505dad 100644 --- a/src/libstd/bitflags.rs +++ b/src/libstd/bitflags.rs @@ -33,6 +33,8 @@ /// } /// } /// +/// impl Copy for Flags {} +/// /// fn main() { /// let e1 = FLAG_A | FLAG_C; /// let e2 = FLAG_B | FLAG_C; @@ -55,6 +57,8 @@ /// } /// } /// +/// impl Copy for Flags {} +/// /// impl Flags { /// pub fn clear(&mut self) { /// self.bits = 0; // The `bits` field can be accessed from within the @@ -260,6 +264,7 @@ macro_rules! bitflags { #[cfg(test)] #[allow(non_upper_case_globals)] mod tests { + use kinds::Copy; use hash; use option::Option::{Some, None}; use ops::{BitOr, BitAnd, BitXor, Sub, Not}; @@ -283,12 +288,16 @@ mod tests { } } + impl Copy for Flags {} + bitflags! { flags AnotherSetOfFlags: i8 { const AnotherFlag = -1_i8, } } + impl Copy for AnotherSetOfFlags {} + #[test] fn test_bits(){ assert_eq!(Flags::empty().bits(), 0x00000000); |
