about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-11-29 21:51:34 +0000
committerbors <bors@rust-lang.org>2014-11-29 21:51:34 +0000
commit8d8f41b75f9bec7c7676122f85e049e7d7933298 (patch)
tree366fb96caa5942f085da0d1e08d8e9c36c3e4323 /src/libsyntax/ext
parent6163581451a089a8d07bed4dba058677ee4a21f3 (diff)
parent004533ea755ecfc5d65e282366aaffc523e9632c (diff)
downloadrust-8d8f41b75f9bec7c7676122f85e049e7d7933298.tar.gz
rust-8d8f41b75f9bec7c7676122f85e049e7d7933298.zip
auto merge of #19392 : murarth/rust/rustc-compile-twice, r=nick29581
Closes #19371
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/mtwt.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libsyntax/ext/mtwt.rs b/src/libsyntax/ext/mtwt.rs
index e6d886e28ba..6ba90bbebed 100644
--- a/src/libsyntax/ext/mtwt.rs
+++ b/src/libsyntax/ext/mtwt.rs
@@ -136,6 +136,16 @@ pub fn clear_tables() {
     with_resolve_table_mut(|table| *table = HashMap::new());
 }
 
+/// Reset the tables to their initial state
+pub fn reset_tables() {
+    with_sctable(|table| {
+        *table.table.borrow_mut() = vec!(EmptyCtxt, IllegalCtxt);
+        *table.mark_memo.borrow_mut() = HashMap::new();
+        *table.rename_memo.borrow_mut() = HashMap::new();
+    });
+    with_resolve_table_mut(|table| *table = HashMap::new());
+}
+
 /// Add a value to the end of a vec, return its index
 fn idx_push<T>(vec: &mut Vec<T>, val: T) -> u32 {
     vec.push(val);