Skip to content

Commit d3fc6e1

Browse files
committed
Auto merge of rust-lang#28454 - GSam:master, r=nrc
This is so that the resolution results can be used after analysis, potentially for tool support
2 parents 6c18dd5 + 61cb1ba commit d3fc6e1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/librustc/session/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
601601
"For every macro invocation, print its name and arguments"),
602602
enable_nonzeroing_move_hints: bool = (false, parse_bool,
603603
"Force nonzeroing move optimization on"),
604+
keep_mtwt_tables: bool = (false, parse_bool,
605+
"Don't clear the resolution tables after analysis"),
604606
}
605607

606608
pub fn default_lib_output() -> CrateType {

src/librustc_driver/driver.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,9 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: Session,
675675
|| resolve::resolve_crate(&sess, &ast_map, make_glob_map));
676676

677677
// Discard MTWT tables that aren't required past resolution.
678-
syntax::ext::mtwt::clear_tables();
678+
if !sess.opts.debugging_opts.keep_mtwt_tables {
679+
syntax::ext::mtwt::clear_tables();
680+
}
679681

680682
let named_region_map = time(time_passes, "lifetime resolution",
681683
|| middle::resolve_lifetime::krate(&sess, krate, &def_map));

0 commit comments

Comments
 (0)