Skip to content

Commit a35f9c1

Browse files
committed
Auto merge of rust-lang#117737 - nnethercote:rm-Zkeep-hygiene-data, r=<try>
Remove `-Zkeep-hygiene-data`. It was added way back in rust-lang#28585 under the name `-Zkeep-mtwt-tables`. The justification was: > This is so that the resolution results can be used after analysis, > potentially for tool support. There are no uses of significance in the code base, and various Google searches for both option names (and variants) found nothing of interest. I think this can safely be removed. r? `@davidtwco`
2 parents 0f44eb3 + 2e40d11 commit a35f9c1

File tree

4 files changed

+0
-12
lines changed

4 files changed

+0
-12
lines changed

compiler/rustc_ast_lowering/src/lib.rs

-5
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,6 @@ pub fn lower_to_hir(tcx: TyCtxt<'_>, (): ()) -> hir::Crate<'_> {
443443
drop(ast_index);
444444
sess.time("drop_ast", || drop(krate));
445445

446-
// Discard hygiene data, which isn't required after lowering to HIR.
447-
if !sess.opts.unstable_opts.keep_hygiene_data {
448-
rustc_span::hygiene::clear_syntax_context_map();
449-
}
450-
451446
// Don't hash unless necessary, because it's expensive.
452447
let opt_hir_hash =
453448
if tcx.needs_crate_hash() { Some(compute_hir_hash(tcx, &owners)) } else { None };

compiler/rustc_interface/src/tests.rs

-1
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,6 @@ fn test_unstable_options_tracking_hash() {
679679
untracked!(incremental_info, true);
680680
untracked!(incremental_verify_ich, true);
681681
untracked!(input_stats, true);
682-
untracked!(keep_hygiene_data, true);
683682
untracked!(link_native_libraries, false);
684683
untracked!(llvm_time_trace, true);
685684
untracked!(ls, vec!["all".to_owned()]);

compiler/rustc_session/src/options.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1622,8 +1622,6 @@ options! {
16221622
`=skip-entry`
16231623
`=skip-exit`
16241624
Multiple options can be combined with commas."),
1625-
keep_hygiene_data: bool = (false, parse_bool, [UNTRACKED],
1626-
"keep hygiene data after analysis (default: no)"),
16271625
layout_seed: Option<u64> = (None, parse_opt_number, [TRACKED],
16281626
"seed layout randomization"),
16291627
link_directives: bool = (true, parse_bool, [TRACKED],

compiler/rustc_span/src/hygiene.rs

-4
Original file line numberDiff line numberDiff line change
@@ -569,10 +569,6 @@ impl HygieneData {
569569
}
570570
}
571571

572-
pub fn clear_syntax_context_map() {
573-
HygieneData::with(|data| data.syntax_context_map = FxHashMap::default());
574-
}
575-
576572
pub fn walk_chain(span: Span, to: SyntaxContext) -> Span {
577573
HygieneData::with(|data| data.walk_chain(span, to))
578574
}

0 commit comments

Comments
 (0)