Skip to content

Commit 588f3c5

Browse files
committed
don't clear the ident interner until lints are done
1 parent 0c5d651 commit 588f3c5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/librustc_driver/driver.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,6 @@ pub fn compile_input(sess: &Session,
257257
tcx.print_debug_stats();
258258
}
259259

260-
// Discard interned strings as they are no longer required.
261-
token::get_ident_interner().clear();
262-
263260
Ok((outputs, trans))
264261
})??
265262
};
@@ -1009,11 +1006,13 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
10091006
|| lint::check_crate(tcx, &analysis.access_levels));
10101007

10111008
// The above three passes generate errors w/o aborting
1012-
if sess.err_count() > 0 {
1013-
return Ok(f(tcx, Some(mir_map), analysis, Err(sess.err_count())));
1014-
}
1009+
let errors = if sess.err_count() == 0 { Ok(()) } else { Err(sess.err_count()) };
1010+
1011+
let result = f(tcx, Some(mir_map), analysis, errors);
10151012

1016-
Ok(f(tcx, Some(mir_map), analysis, Ok(())))
1013+
// Discard interned strings as they are no longer required.
1014+
token::get_ident_interner().clear();
1015+
Ok(result)
10171016
})
10181017
}
10191018

0 commit comments

Comments
 (0)