Skip to content

Commit

Permalink
libsyntax: use #[deriving(Copy)]
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Aparicio committed Dec 19, 2014
1 parent a77e8a6 commit 86f8c12
Show file tree
Hide file tree
Showing 19 changed files with 77 additions and 216 deletions.
19 changes: 5 additions & 14 deletions src/libsyntax/abi.rs
Expand Up @@ -15,7 +15,7 @@ pub use self::AbiArchitecture::*;

use std::fmt;

#[deriving(PartialEq)]
#[deriving(Copy, PartialEq)]
pub enum Os {
OsWindows,
OsMacos,
Expand All @@ -26,9 +26,7 @@ pub enum Os {
OsDragonfly,
}

impl Copy for Os {}

#[deriving(PartialEq, Eq, Hash, Encodable, Decodable, Clone)]
#[deriving(Copy, PartialEq, Eq, Hash, Encodable, Decodable, Clone)]
pub enum Abi {
// NB: This ordering MUST match the AbiDatas array below.
// (This is ensured by the test indices_are_correct().)
Expand All @@ -48,10 +46,8 @@ pub enum Abi {
RustCall,
}

impl Copy for Abi {}

#[allow(non_camel_case_types)]
#[deriving(PartialEq)]
#[deriving(Copy, PartialEq)]
pub enum Architecture {
X86,
X86_64,
Expand All @@ -60,17 +56,15 @@ pub enum Architecture {
Mipsel
}

impl Copy for Architecture {}

#[deriving(Copy)]
pub struct AbiData {
abi: Abi,

// Name of this ABI as we like it called.
name: &'static str,
}

impl Copy for AbiData {}

#[deriving(Copy)]
pub enum AbiArchitecture {
/// Not a real ABI (e.g., intrinsic)
RustArch,
Expand All @@ -80,9 +74,6 @@ pub enum AbiArchitecture {
Archs(u32)
}

#[allow(non_upper_case_globals)]
impl Copy for AbiArchitecture {}

#[allow(non_upper_case_globals)]
static AbiDatas: &'static [AbiData] = &[
// Platform-specific ABIs
Expand Down

0 comments on commit 86f8c12

Please sign in to comment.