about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-02-22 02:16:12 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-02-22 02:16:12 +0530
commit686648d15546cead638ababda5a70d8f36fbc78a (patch)
tree038fef94f8b208553ce2bc0409d9f051bc88693d /src/libsyntax
parent5d7b216f40d13750a31a22ecc20498494f76cbc6 (diff)
parent6686f7aa471f162697d08a78ad4d04d3c0e9612c (diff)
downloadrust-686648d15546cead638ababda5a70d8f36fbc78a.tar.gz
rust-686648d15546cead638ababda5a70d8f36fbc78a.zip
Rollup merge of #22584 - alexcrichton:snapshots, r=Gankro
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ptr.rs7
-rw-r--r--src/libsyntax/util/interner.rs75
2 files changed, 0 insertions, 82 deletions
diff --git a/src/libsyntax/ptr.rs b/src/libsyntax/ptr.rs
index adb5383a8fd..ca3a1848c3a 100644
--- a/src/libsyntax/ptr.rs
+++ b/src/libsyntax/ptr.rs
@@ -111,13 +111,6 @@ impl<T: Display> Display for P<T> {
     }
 }
 
-#[cfg(stage0)]
-impl<S: Hasher, T: Hash<S>> Hash<S> for P<T> {
-    fn hash(&self, state: &mut S) {
-        (**self).hash(state);
-    }
-}
-#[cfg(not(stage0))]
 impl<T: Hash> Hash for P<T> {
     fn hash<H: Hasher>(&self, state: &mut H) {
         (**self).hash(state);
diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs
index dffeac6f3f7..5be45a2698f 100644
--- a/src/libsyntax/util/interner.rs
+++ b/src/libsyntax/util/interner.rs
@@ -18,7 +18,6 @@ use std::borrow::Borrow;
 use std::cell::RefCell;
 use std::cmp::Ordering;
 use std::collections::HashMap;
-#[cfg(stage0)] use std::collections::hash_map::Hasher;
 use std::fmt;
 use std::hash::Hash;
 use std::ops::Deref;
@@ -30,71 +29,6 @@ pub struct Interner<T> {
 }
 
 // when traits can extend traits, we should extend index<Name,T> to get []
-#[cfg(stage0)]
-impl<T: Eq + Hash<Hasher> + Clone + 'static> Interner<T> {
-    pub fn new() -> Interner<T> {
-        Interner {
-            map: RefCell::new(HashMap::new()),
-            vect: RefCell::new(Vec::new()),
-        }
-    }
-
-    pub fn prefill(init: &[T]) -> Interner<T> {
-        let rv = Interner::new();
-        for v in init {
-            rv.intern((*v).clone());
-        }
-        rv
-    }
-
-    pub fn intern(&self, val: T) -> Name {
-        let mut map = self.map.borrow_mut();
-        match (*map).get(&val) {
-            Some(&idx) => return idx,
-            None => (),
-        }
-
-        let mut vect = self.vect.borrow_mut();
-        let new_idx = Name((*vect).len() as u32);
-        (*map).insert(val.clone(), new_idx);
-        (*vect).push(val);
-        new_idx
-    }
-
-    pub fn gensym(&self, val: T) -> Name {
-        let mut vect = self.vect.borrow_mut();
-        let new_idx = Name((*vect).len() as u32);
-        // leave out of .map to avoid colliding
-        (*vect).push(val);
-        new_idx
-    }
-
-    pub fn get(&self, idx: Name) -> T {
-        let vect = self.vect.borrow();
-        (*vect)[idx.usize()].clone()
-    }
-
-    pub fn len(&self) -> usize {
-        let vect = self.vect.borrow();
-        (*vect).len()
-    }
-
-    pub fn find<Q: ?Sized>(&self, val: &Q) -> Option<Name>
-    where T: Borrow<Q>, Q: Eq + Hash<Hasher> {
-        let map = self.map.borrow();
-        match (*map).get(val) {
-            Some(v) => Some(*v),
-            None => None,
-        }
-    }
-
-    pub fn clear(&self) {
-        *self.map.borrow_mut() = HashMap::new();
-        *self.vect.borrow_mut() = Vec::new();
-    }
-}
-// when traits can extend traits, we should extend index<Name,T> to get []
-#[cfg(not(stage0))]
 impl<T: Eq + Hash + Clone + 'static> Interner<T> {
     pub fn new() -> Interner<T> {
         Interner {
@@ -275,15 +209,6 @@ impl StrInterner {
         self.vect.borrow().len()
     }
 
-    #[cfg(stage0)]
-    pub fn find<Q: ?Sized>(&self, val: &Q) -> Option<Name>
-    where RcStr: Borrow<Q>, Q: Eq + Hash<Hasher> {
-        match (*self.map.borrow()).get(val) {
-            Some(v) => Some(*v),
-            None => None,
-        }
-    }
-    #[cfg(not(stage0))]
     pub fn find<Q: ?Sized>(&self, val: &Q) -> Option<Name>
     where RcStr: Borrow<Q>, Q: Eq + Hash {
         match (*self.map.borrow()).get(val) {