about summary refs log tree commit diff
path: root/src/libsyntax/util/interner.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/util/interner.rs')
-rw-r--r--src/libsyntax/util/interner.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs
index 969c7cec87c..c1ed96fe4de 100644
--- a/src/libsyntax/util/interner.rs
+++ b/src/libsyntax/util/interner.rs
@@ -84,6 +84,11 @@ impl<T:Eq + Hash + Freeze + Clone + 'static> Interner<T> {
             None => None,
         }
     }
+
+    pub fn clear(&self) {
+        *self.map.borrow_mut().get() = HashMap::new();
+        *self.vect.borrow_mut().get() = Vec::new();
+    }
 }
 
 #[deriving(Clone, Eq, Hash, Ord)]
@@ -222,6 +227,11 @@ impl StrInterner {
             None => None,
         }
     }
+
+    pub fn clear(&self) {
+        *self.map.borrow_mut().get() = HashMap::new();
+        *self.vect.borrow_mut().get() = Vec::new();
+    }
 }
 
 #[cfg(test)]