From 588f3c59465084602120c231fb28c88df48cdeaa Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Fri, 20 May 2016 14:23:45 +0200 Subject: [PATCH] don't clear the ident interner until lints are done --- src/librustc_driver/driver.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index 1d60c2eb43788..7f4720d62cfd2 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -257,9 +257,6 @@ pub fn compile_input(sess: &Session, tcx.print_debug_stats(); } - // Discard interned strings as they are no longer required. - token::get_ident_interner().clear(); - Ok((outputs, trans)) })?? }; @@ -1009,11 +1006,13 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session, || lint::check_crate(tcx, &analysis.access_levels)); // The above three passes generate errors w/o aborting - if sess.err_count() > 0 { - return Ok(f(tcx, Some(mir_map), analysis, Err(sess.err_count()))); - } + let errors = if sess.err_count() == 0 { Ok(()) } else { Err(sess.err_count()) }; + + let result = f(tcx, Some(mir_map), analysis, errors); - Ok(f(tcx, Some(mir_map), analysis, Ok(()))) + // Discard interned strings as they are no longer required. + token::get_ident_interner().clear(); + Ok(result) }) }