@@ -42,7 +42,6 @@ use rustc_session::search_paths::PathKind;
4242use rustc_span:: {
4343 DUMMY_SP , ErrorGuaranteed , ExpnKind , SourceFileHash , SourceFileHashAlgorithm , Span , Symbol , sym,
4444} ;
45- use rustc_data_structures:: sync:: spawn;
4645use rustc_trait_selection:: { solve, traits} ;
4746use tracing:: { info, instrument} ;
4847
@@ -883,6 +882,7 @@ pub static DEFAULT_QUERY_PROVIDERS: LazyLock<Providers> = LazyLock::new(|| {
883882 providers. queries . analysis = analysis;
884883 providers. queries . hir_crate = rustc_ast_lowering:: lower_to_hir;
885884 providers. queries . lower_to_hir_delayed = rustc_ast_lowering:: lower_to_hir_delayed;
885+ providers. queries . force_delayed_hir_lowering = rustc_ast_lowering:: force_delayed_hir_lowering;
886886 providers. queries . resolver_for_lowering_raw = resolver_for_lowering_raw;
887887 providers. queries . stripped_cfg_items = |tcx, _| & tcx. resolutions ( ( ) ) . stripped_cfg_items [ ..] ;
888888 providers. queries . resolutions = |tcx, ( ) | tcx. resolver_for_lowering_raw ( ( ) ) . 1 ;
@@ -1026,27 +1026,9 @@ pub fn create_and_enter_global_ctxt<T, F: for<'tcx> FnOnce(TyCtxt<'tcx>) -> T>(
10261026 )
10271027}
10281028
1029- fn lower_delayed_hir ( tcx : TyCtxt < ' _ > ) {
1030- let krate = tcx. hir_crate ( ( ) ) ;
1031- for id in krate. delayed_ids . iter ( ) . copied ( ) {
1032- let _ = tcx. lower_to_hir_delayed ( id) ;
1033- }
1034-
1035- let ( _, krate) = tcx. resolver_for_lowering ( ) . steal ( ) ;
1036- let prof = tcx. sess . prof . clone ( ) ;
1037-
1038- // Drop AST to free memory. It can be expensive so try to drop it on a separate thread.
1039- spawn ( move || {
1040- let _timer = prof. verbose_generic_activity ( "drop_ast" ) ;
1041- drop ( krate) ;
1042- } ) ;
1043- }
1044-
10451029/// Runs all analyses that we guarantee to run, even if errors were reported in earlier analyses.
10461030/// This function never fails.
10471031fn run_required_analyses ( tcx : TyCtxt < ' _ > ) {
1048- lower_delayed_hir ( tcx) ;
1049-
10501032 if tcx. sess . opts . unstable_opts . input_stats {
10511033 rustc_passes:: input_stats:: print_hir_stats ( tcx) ;
10521034 }
0 commit comments