Skip to content

Commit 319c379

Browse files
committed
Add Copy to bitflags-generated structures
1 parent c38e73f commit 319c379

File tree

6 files changed

+1
-16
lines changed

6 files changed

+1
-16
lines changed

src/librustc/middle/resolve.rs

-2
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,6 @@ bitflags! {
633633
}
634634
}
635635

636-
impl Copy for DefModifiers {}
637-
638636
// Records a possibly-private type definition.
639637
#[deriving(Clone)]
640638
struct TypeNsDef {

src/librustc/middle/ty.rs

-2
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,6 @@ bitflags! {
800800
}
801801
}
802802

803-
impl Copy for TypeFlags {}
804-
805803
#[deriving(Show)]
806804
pub struct TyS<'tcx> {
807805
pub sty: sty<'tcx>,

src/librustc_llvm/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ bitflags! {
149149
}
150150
}
151151

152-
impl Copy for Attribute {}
153152

154153
#[repr(u64)]
155154
pub enum OtherAttribute {

src/libstd/bitflags.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
/// }
3434
/// }
3535
///
36-
/// impl Copy for Flags {}
37-
///
3836
/// fn main() {
3937
/// let e1 = FLAG_A | FLAG_C;
4038
/// let e2 = FLAG_B | FLAG_C;
@@ -57,8 +55,6 @@
5755
/// }
5856
/// }
5957
///
60-
/// impl Copy for Flags {}
61-
///
6258
/// impl Flags {
6359
/// pub fn clear(&mut self) {
6460
/// self.bits = 0; // The `bits` field can be accessed from within the
@@ -121,7 +117,7 @@ macro_rules! bitflags {
121117
($(#[$attr:meta])* flags $BitFlags:ident: $T:ty {
122118
$($(#[$Flag_attr:meta])* const $Flag:ident = $value:expr),+
123119
}) => {
124-
#[deriving(PartialEq, Eq, Clone, PartialOrd, Ord, Hash)]
120+
#[deriving(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash)]
125121
$(#[$attr])*
126122
pub struct $BitFlags {
127123
bits: $T,
@@ -288,16 +284,12 @@ mod tests {
288284
}
289285
}
290286

291-
impl Copy for Flags {}
292-
293287
bitflags! {
294288
flags AnotherSetOfFlags: i8 {
295289
const AnotherFlag = -1_i8,
296290
}
297291
}
298292

299-
impl Copy for AnotherSetOfFlags {}
300-
301293
#[test]
302294
fn test_bits(){
303295
assert_eq!(Flags::empty().bits(), 0x00000000);

src/libstd/io/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1904,7 +1904,6 @@ bitflags! {
19041904
}
19051905
}
19061906

1907-
impl Copy for FilePermission {}
19081907

19091908
impl Default for FilePermission {
19101909
#[inline]

src/libsyntax/parse/parser.rs

-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ bitflags! {
9898
}
9999
}
100100

101-
impl Copy for Restrictions {}
102101

103102
type ItemInfo = (Ident, Item_, Option<Vec<Attribute> >);
104103

0 commit comments

Comments
 (0)