]> git.lizzy.rs Git - rust.git/commitdiff
Add `librustc_driver::driver::reset_thread_local_state` and
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>
Sat, 16 Jul 2016 16:12:56 +0000 (16:12 +0000)
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>
Mon, 18 Jul 2016 10:10:11 +0000 (10:10 +0000)
remove the thread local state reset at the beginning of `phase_1_parse_input`.

src/librustc_driver/driver.rs

index ab3b20e08c8099130c1b5c3a874a519f9b29fddb..9a94cc16bfe8ceda4709be95262b1a6ff4cdc001 100644 (file)
@@ -478,10 +478,6 @@ pub fn phase_1_parse_input<'a>(sess: &'a Session,
                                cfg: ast::CrateConfig,
                                input: &Input)
                                -> PResult<'a, ast::Crate> {
-    // These may be left in an incoherent state after a previous compile.
-    syntax::ext::hygiene::reset_hygiene_data();
-    // `clear_ident_interner` can be used to free memory, but it does not restore the initial state.
-    token::reset_ident_interner();
     let continue_after_error = sess.opts.continue_parse_after_error;
     sess.diagnostic().set_continue_after_error(continue_after_error);
 
@@ -1298,3 +1294,11 @@ pub fn build_output_filenames(input: &Input,
         }
     }
 }
+
+// For use by the `rusti` project (https://github.com/murarth/rusti).
+pub fn reset_thread_local_state() {
+    // These may be left in an incoherent state after a previous compile.
+    syntax::ext::hygiene::reset_hygiene_data();
+    // `clear_ident_interner` can be used to free memory, but it does not restore the initial state.
+    token::reset_ident_interner();
+}