auto merge of #19742 : vhbit/rust/copy-for-bitflags, r=alexcrichton
This commit is contained in:
commit
126db549b0
6 changed files with 1 additions and 16 deletions
|
@ -635,8 +635,6 @@ bitflags! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Copy for DefModifiers {}
|
|
||||||
|
|
||||||
// Records a possibly-private type definition.
|
// Records a possibly-private type definition.
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
struct TypeNsDef {
|
struct TypeNsDef {
|
||||||
|
|
|
@ -801,8 +801,6 @@ bitflags! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Copy for TypeFlags {}
|
|
||||||
|
|
||||||
#[deriving(Show)]
|
#[deriving(Show)]
|
||||||
pub struct TyS<'tcx> {
|
pub struct TyS<'tcx> {
|
||||||
pub sty: sty<'tcx>,
|
pub sty: sty<'tcx>,
|
||||||
|
|
|
@ -150,7 +150,6 @@ bitflags! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Copy for Attribute {}
|
|
||||||
|
|
||||||
#[repr(u64)]
|
#[repr(u64)]
|
||||||
pub enum OtherAttribute {
|
pub enum OtherAttribute {
|
||||||
|
|
|
@ -33,8 +33,6 @@
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// impl Copy for Flags {}
|
|
||||||
///
|
|
||||||
/// fn main() {
|
/// fn main() {
|
||||||
/// let e1 = FLAG_A | FLAG_C;
|
/// let e1 = FLAG_A | FLAG_C;
|
||||||
/// let e2 = FLAG_B | FLAG_C;
|
/// let e2 = FLAG_B | FLAG_C;
|
||||||
|
@ -57,8 +55,6 @@
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// impl Copy for Flags {}
|
|
||||||
///
|
|
||||||
/// impl Flags {
|
/// impl Flags {
|
||||||
/// pub fn clear(&mut self) {
|
/// pub fn clear(&mut self) {
|
||||||
/// self.bits = 0; // The `bits` field can be accessed from within the
|
/// self.bits = 0; // The `bits` field can be accessed from within the
|
||||||
|
@ -121,7 +117,7 @@ macro_rules! bitflags {
|
||||||
($(#[$attr:meta])* flags $BitFlags:ident: $T:ty {
|
($(#[$attr:meta])* flags $BitFlags:ident: $T:ty {
|
||||||
$($(#[$Flag_attr:meta])* const $Flag:ident = $value:expr),+
|
$($(#[$Flag_attr:meta])* const $Flag:ident = $value:expr),+
|
||||||
}) => {
|
}) => {
|
||||||
#[deriving(PartialEq, Eq, Clone, PartialOrd, Ord, Hash)]
|
#[deriving(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash)]
|
||||||
$(#[$attr])*
|
$(#[$attr])*
|
||||||
pub struct $BitFlags {
|
pub struct $BitFlags {
|
||||||
bits: $T,
|
bits: $T,
|
||||||
|
@ -288,16 +284,12 @@ mod tests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Copy for Flags {}
|
|
||||||
|
|
||||||
bitflags! {
|
bitflags! {
|
||||||
flags AnotherSetOfFlags: i8 {
|
flags AnotherSetOfFlags: i8 {
|
||||||
const AnotherFlag = -1_i8,
|
const AnotherFlag = -1_i8,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Copy for AnotherSetOfFlags {}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_bits(){
|
fn test_bits(){
|
||||||
assert_eq!(Flags::empty().bits(), 0x00000000);
|
assert_eq!(Flags::empty().bits(), 0x00000000);
|
||||||
|
|
|
@ -1910,7 +1910,6 @@ bitflags! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Copy for FilePermission {}
|
|
||||||
|
|
||||||
impl Default for FilePermission {
|
impl Default for FilePermission {
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
|
@ -98,7 +98,6 @@ bitflags! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Copy for Restrictions {}
|
|
||||||
|
|
||||||
type ItemInfo = (Ident, Item_, Option<Vec<Attribute> >);
|
type ItemInfo = (Ident, Item_, Option<Vec<Attribute> >);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue