@@ -280,7 +280,7 @@ fn configure_and_expand(
280280
281281fn early_lint_checks ( tcx : TyCtxt < ' _ > , ( ) : ( ) ) {
282282 let sess = tcx. sess ;
283- let ( resolver, krate) = & * tcx. resolver_for_lowering ( ( ) ) . borrow ( ) ;
283+ let ( resolver, krate) = & * tcx. resolver_for_lowering ( ) . borrow ( ) ;
284284 let mut lint_buffer = resolver. lint_buffer . steal ( ) ;
285285
286286 if sess. opts . unstable_opts . input_stats {
@@ -531,10 +531,10 @@ fn write_out_deps(tcx: TyCtxt<'_>, outputs: &OutputFilenames, out_filenames: &[P
531531 }
532532}
533533
534- fn resolver_for_lowering < ' tcx > (
534+ fn resolver_for_lowering_raw < ' tcx > (
535535 tcx : TyCtxt < ' tcx > ,
536536 ( ) : ( ) ,
537- ) -> & ' tcx Steal < ( ty:: ResolverAstLowering , Lrc < ast:: Crate > ) > {
537+ ) -> ( & ' tcx Steal < ( ty:: ResolverAstLowering , Lrc < ast:: Crate > ) > , & ' tcx ty :: ResolverGlobalCtxt ) {
538538 let arenas = Resolver :: arenas ( ) ;
539539 let _ = tcx. registered_tools ( ( ) ) ; // Uses `crate_for_resolver`.
540540 let ( krate, pre_configured_attrs) = tcx. crate_for_resolver ( ( ) ) . steal ( ) ;
@@ -549,16 +549,15 @@ fn resolver_for_lowering<'tcx>(
549549 ast_lowering : untracked_resolver_for_lowering,
550550 } = resolver. into_outputs ( ) ;
551551
552- let feed = tcx. feed_unit_query ( ) ;
553- feed. resolutions ( tcx. arena . alloc ( untracked_resolutions) ) ;
554- tcx. arena . alloc ( Steal :: new ( ( untracked_resolver_for_lowering, Lrc :: new ( krate) ) ) )
552+ let resolutions = tcx. arena . alloc ( untracked_resolutions) ;
553+ ( tcx. arena . alloc ( Steal :: new ( ( untracked_resolver_for_lowering, Lrc :: new ( krate) ) ) ) , resolutions)
555554}
556555
557556pub ( crate ) fn write_dep_info ( tcx : TyCtxt < ' _ > ) {
558557 // Make sure name resolution and macro expansion is run for
559558 // the side-effect of providing a complete set of all
560559 // accessed files and env vars.
561- let _ = tcx. resolver_for_lowering ( ( ) ) ;
560+ let _ = tcx. resolver_for_lowering ( ) ;
562561
563562 let sess = tcx. sess ;
564563 let _timer = sess. timer ( "write_dep_info" ) ;
@@ -607,9 +606,10 @@ pub static DEFAULT_QUERY_PROVIDERS: LazyLock<Providers> = LazyLock::new(|| {
607606 let providers = & mut Providers :: default ( ) ;
608607 providers. analysis = analysis;
609608 providers. hir_crate = rustc_ast_lowering:: lower_to_hir;
610- providers. resolver_for_lowering = resolver_for_lowering ;
609+ providers. resolver_for_lowering_raw = resolver_for_lowering_raw ;
611610 providers. stripped_cfg_items =
612611 |tcx, _| tcx. arena . alloc_from_iter ( tcx. resolutions ( ( ) ) . stripped_cfg_items . steal ( ) ) ;
612+ providers. resolutions = |tcx, ( ) | tcx. resolver_for_lowering_raw ( ( ) ) . 1 ;
613613 providers. early_lint_checks = early_lint_checks;
614614 proc_macro_decls:: provide ( providers) ;
615615 rustc_const_eval:: provide ( providers) ;
0 commit comments