about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-02-23 13:07:01 -0800
committerbors <bors@rust-lang.org>2014-02-23 13:07:01 -0800
commitba037475eed06e62fce768720e74697097b4abbb (patch)
tree6ad2c1d2c82efeb6d2e85e58a79475a3f1c4747d /src/libsyntax/parse
parent8786405047cadcfb5ec3a2d711ca264d74843c13 (diff)
parentefaf4db24c92e119e26dc575ffd6bfd3b91fb87d (diff)
downloadrust-ba037475eed06e62fce768720e74697097b4abbb.tar.gz
rust-ba037475eed06e62fce768720e74697097b4abbb.zip
auto merge of #12492 : huonw/rust/snapshots, r=alexcrichton
Replaces IterBytes with the new Hash, removing all trace of the old implementation.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/obsolete.rs11
-rw-r--r--src/libsyntax/parse/token.rs8
2 files changed, 5 insertions, 14 deletions
diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs
index accffd374a9..393282dd063 100644
--- a/src/libsyntax/parse/obsolete.rs
+++ b/src/libsyntax/parse/obsolete.rs
@@ -22,10 +22,8 @@ use codemap::{Span, respan};
 use parse::parser::Parser;
 use parse::token;
 
-use std::to_bytes;
-
 /// The specific types of unsupported syntax
-#[deriving(Eq)]
+#[deriving(Eq, Hash)]
 pub enum ObsoleteSyntax {
     ObsoleteSwap,
     ObsoleteUnsafeBlock,
@@ -46,13 +44,6 @@ pub enum ObsoleteSyntax {
     ObsoleteManagedVec,
 }
 
-impl to_bytes::IterBytes for ObsoleteSyntax {
-    #[inline]
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
-        (*self as uint).iter_bytes(lsb0, f)
-    }
-}
-
 pub trait ParserObsoleteMethods {
     /// Reports an obsolete syntax non-fatal error.
     fn obsolete(&mut self, sp: Span, kind: ObsoleteSyntax);
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index b264e8d7467..a2f3b65f06e 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -23,7 +23,7 @@ use std::local_data;
 use std::path::BytesContainer;
 
 #[allow(non_camel_case_types)]
-#[deriving(Clone, Encodable, Decodable, Eq, IterBytes)]
+#[deriving(Clone, Encodable, Decodable, Eq, Hash)]
 pub enum BinOp {
     PLUS,
     MINUS,
@@ -38,7 +38,7 @@ pub enum BinOp {
 }
 
 #[allow(non_camel_case_types)]
-#[deriving(Clone, Encodable, Decodable, Eq, IterBytes)]
+#[deriving(Clone, Encodable, Decodable, Eq, Hash)]
 pub enum Token {
     /* Expression-operator symbols. */
     EQ,
@@ -102,7 +102,7 @@ pub enum Token {
     EOF,
 }
 
-#[deriving(Clone, Encodable, Decodable, Eq, IterBytes)]
+#[deriving(Clone, Encodable, Decodable, Eq, Hash)]
 /// For interpolation during macro expansion.
 pub enum Nonterminal {
     NtItem(@ast::Item),
@@ -536,7 +536,7 @@ pub fn get_ident_interner() -> @IdentInterner {
 /// destroyed. In particular, they must not access string contents. This can
 /// be fixed in the future by just leaking all strings until task death
 /// somehow.
-#[deriving(Clone, Eq, IterBytes, Ord, TotalEq, TotalOrd)]
+#[deriving(Clone, Eq, Hash, Ord, TotalEq, TotalOrd)]
 pub struct InternedString {
     priv string: RcStr,
 }