Skip to content

Commit 86f8c12

Browse files
author
Jorge Aparicio
committed
libsyntax: use #[deriving(Copy)]
1 parent a77e8a6 commit 86f8c12

File tree

19 files changed

+77
-216
lines changed

19 files changed

+77
-216
lines changed

src/libsyntax/abi.rs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub use self::AbiArchitecture::*;
1515

1616
use std::fmt;
1717

18-
#[deriving(PartialEq)]
18+
#[deriving(Copy, PartialEq)]
1919
pub enum Os {
2020
OsWindows,
2121
OsMacos,
@@ -26,9 +26,7 @@ pub enum Os {
2626
OsDragonfly,
2727
}
2828

29-
impl Copy for Os {}
30-
31-
#[deriving(PartialEq, Eq, Hash, Encodable, Decodable, Clone)]
29+
#[deriving(Copy, PartialEq, Eq, Hash, Encodable, Decodable, Clone)]
3230
pub enum Abi {
3331
// NB: This ordering MUST match the AbiDatas array below.
3432
// (This is ensured by the test indices_are_correct().)
@@ -48,10 +46,8 @@ pub enum Abi {
4846
RustCall,
4947
}
5048

51-
impl Copy for Abi {}
52-
5349
#[allow(non_camel_case_types)]
54-
#[deriving(PartialEq)]
50+
#[deriving(Copy, PartialEq)]
5551
pub enum Architecture {
5652
X86,
5753
X86_64,
@@ -60,17 +56,15 @@ pub enum Architecture {
6056
Mipsel
6157
}
6258

63-
impl Copy for Architecture {}
64-
59+
#[deriving(Copy)]
6560
pub struct AbiData {
6661
abi: Abi,
6762

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

72-
impl Copy for AbiData {}
73-
67+
#[deriving(Copy)]
7468
pub enum AbiArchitecture {
7569
/// Not a real ABI (e.g., intrinsic)
7670
RustArch,
@@ -80,9 +74,6 @@ pub enum AbiArchitecture {
8074
Archs(u32)
8175
}
8276

83-
#[allow(non_upper_case_globals)]
84-
impl Copy for AbiArchitecture {}
85-
8677
#[allow(non_upper_case_globals)]
8778
static AbiDatas: &'static [AbiData] = &[
8879
// Platform-specific ABIs

0 commit comments

Comments
 (0)