about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-12-19 16:02:31 +0000
committerbors <bors@rust-lang.org>2014-12-19 16:02:31 +0000
commit95c2ed31aeb66b2662933200dbfd661a573b1f49 (patch)
tree3e397ee769c09211083f8aa12377e41104575f7f /src/libsyntax/parse
parentbd90b936d73c0ea2c261cd8e7b9c43764cb2da05 (diff)
parentf975b10310b2f38a5ac1e50f30778b85ed963849 (diff)
downloadrust-95c2ed31aeb66b2662933200dbfd661a573b1f49.tar.gz
rust-95c2ed31aeb66b2662933200dbfd661a573b1f49.zip
auto merge of #19867 : japaric/rust/deriving-copy, r=acrichto
r? @alexcrichton 
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/lexer/comments.rs4
-rw-r--r--src/libsyntax/parse/obsolete.rs4
-rw-r--r--src/libsyntax/parse/parser.rs4
-rw-r--r--src/libsyntax/parse/token.rs19
4 files changed, 8 insertions, 23 deletions
diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs
index a17d66476c0..95bae63f58f 100644
--- a/src/libsyntax/parse/lexer/comments.rs
+++ b/src/libsyntax/parse/lexer/comments.rs
@@ -24,7 +24,7 @@ use std::str;
 use std::string::String;
 use std::uint;
 
-#[deriving(Clone, PartialEq)]
+#[deriving(Clone, Copy, PartialEq)]
 pub enum CommentStyle {
     /// No code on either side of each line of the comment
     Isolated,
@@ -36,8 +36,6 @@ pub enum CommentStyle {
     BlankLine,
 }
 
-impl Copy for CommentStyle {}
-
 #[deriving(Clone)]
 pub struct Comment {
     pub style: CommentStyle,
diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs
index 3a7cc77515d..a6ddcbf9ac4 100644
--- a/src/libsyntax/parse/obsolete.rs
+++ b/src/libsyntax/parse/obsolete.rs
@@ -22,7 +22,7 @@ use parse::token;
 use ptr::P;
 
 /// The specific types of unsupported syntax
-#[deriving(PartialEq, Eq, Hash)]
+#[deriving(Copy, PartialEq, Eq, Hash)]
 pub enum ObsoleteSyntax {
     ObsoleteOwnedType,
     ObsoleteOwnedExpr,
@@ -36,8 +36,6 @@ pub enum ObsoleteSyntax {
     ObsoleteProcExpr,
 }
 
-impl Copy for ObsoleteSyntax {}
-
 pub trait ParserObsoleteMethods {
     /// Reports an obsolete syntax non-fatal error.
     fn obsolete(&mut self, sp: Span, kind: ObsoleteSyntax);
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index c234c172fd8..3ad224b93ce 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -104,7 +104,7 @@ type ItemInfo = (Ident, Item_, Option<Vec<Attribute> >);
 
 /// How to parse a path. There are four different kinds of paths, all of which
 /// are parsed somewhat differently.
-#[deriving(PartialEq)]
+#[deriving(Copy, PartialEq)]
 pub enum PathParsingMode {
     /// A path with no type parameters; e.g. `foo::bar::Baz`
     NoTypesAllowed,
@@ -116,8 +116,6 @@ pub enum PathParsingMode {
     LifetimeAndTypesWithColons,
 }
 
-impl Copy for PathParsingMode {}
-
 enum ItemOrViewItem {
     /// Indicates a failure to parse any kind of item. The attributes are
     /// returned.
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 641239f1f8b..dad369792d7 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -28,7 +28,7 @@ use std::path::BytesContainer;
 use std::rc::Rc;
 
 #[allow(non_camel_case_types)]
-#[deriving(Clone, Encodable, Decodable, PartialEq, Eq, Hash, Show)]
+#[deriving(Clone, Copy, Encodable, Decodable, PartialEq, Eq, Hash, Show)]
 pub enum BinOpToken {
     Plus,
     Minus,
@@ -42,10 +42,8 @@ pub enum BinOpToken {
     Shr,
 }
 
-impl Copy for BinOpToken {}
-
 /// A delimeter token
-#[deriving(Clone, Encodable, Decodable, PartialEq, Eq, Hash, Show)]
+#[deriving(Clone, Copy, Encodable, Decodable, PartialEq, Eq, Hash, Show)]
 pub enum DelimToken {
     /// A round parenthesis: `(` or `)`
     Paren,
@@ -55,16 +53,14 @@ pub enum DelimToken {
     Brace,
 }
 
-impl Copy for DelimToken {}
-
-#[deriving(Clone, Encodable, Decodable, PartialEq, Eq, Hash, Show)]
+#[deriving(Clone, Copy, Encodable, Decodable, PartialEq, Eq, Hash, Show)]
 pub enum IdentStyle {
     /// `::` follows the identifier with no whitespace in-between.
     ModName,
     Plain,
 }
 
-#[deriving(Clone, Encodable, Decodable, PartialEq, Eq, Hash, Show)]
+#[deriving(Clone, Copy, Encodable, Decodable, PartialEq, Eq, Hash, Show)]
 pub enum Lit {
     Byte(ast::Name),
     Char(ast::Name),
@@ -89,10 +85,6 @@ impl Lit {
     }
 }
 
-impl Copy for Lit {}
-
-impl Copy for IdentStyle {}
-
 #[allow(non_camel_case_types)]
 #[deriving(Clone, Encodable, Decodable, PartialEq, Eq, Hash, Show)]
 pub enum Token {
@@ -438,13 +430,12 @@ macro_rules! declare_special_idents_and_keywords {(
         pub use self::Keyword::*;
         use ast;
 
+        #[deriving(Copy)]
         pub enum Keyword {
             $( $sk_variant, )*
             $( $rk_variant, )*
         }
 
-        impl Copy for Keyword {}
-
         impl Keyword {
             pub fn to_name(&self) -> ast::Name {
                 match *self {