@@ -282,7 +282,7 @@ fn configure_and_expand(
282282
283283fn early_lint_checks ( tcx : TyCtxt < ' _ > , ( ) : ( ) ) {
284284 let sess = tcx. sess ;
285- let ( resolver, krate) = & * tcx. resolver_for_lowering ( ( ) ) . borrow ( ) ;
285+ let ( resolver, krate) = & * tcx. resolver_for_lowering ( ( ) ) . 0 . borrow ( ) ;
286286 let mut lint_buffer = resolver. lint_buffer . steal ( ) ;
287287
288288 if sess. opts . unstable_opts . input_stats {
@@ -536,7 +536,7 @@ fn write_out_deps(tcx: TyCtxt<'_>, outputs: &OutputFilenames, out_filenames: &[P
536536fn resolver_for_lowering < ' tcx > (
537537 tcx : TyCtxt < ' tcx > ,
538538 ( ) : ( ) ,
539- ) -> & ' tcx Steal < ( ty:: ResolverAstLowering , Lrc < ast:: Crate > ) > {
539+ ) -> ( & ' tcx Steal < ( ty:: ResolverAstLowering , Lrc < ast:: Crate > ) > , & ' tcx ty :: ResolverGlobalCtxt ) {
540540 let arenas = Resolver :: arenas ( ) ;
541541 let _ = tcx. registered_tools ( ( ) ) ; // Uses `crate_for_resolver`.
542542 let ( krate, pre_configured_attrs) = tcx. crate_for_resolver ( ( ) ) . steal ( ) ;
@@ -551,15 +551,18 @@ fn resolver_for_lowering<'tcx>(
551551 ast_lowering : untracked_resolver_for_lowering,
552552 } = resolver. into_outputs ( ) ;
553553
554- let feed = tcx. feed_unit_query ( ) ;
555- feed. resolutions ( tcx. arena . alloc ( untracked_resolutions) ) ;
556- tcx. arena . alloc ( Steal :: new ( ( untracked_resolver_for_lowering, Lrc :: new ( krate) ) ) )
554+ let resolutions = tcx. arena . alloc ( untracked_resolutions) ;
555+ ( tcx. arena . alloc ( Steal :: new ( ( untracked_resolver_for_lowering, Lrc :: new ( krate) ) ) ) , resolutions)
557556}
558557
559- fn stripped_cfg_items ( tcx : TyCtxt < ' _ > , _: LocalCrate ) -> & ' _ [ StrippedCfgItem ] {
558+ fn stripped_cfg_items ( tcx : TyCtxt < ' _ > , _: LocalCrate ) -> & [ StrippedCfgItem ] {
560559 tcx. arena . alloc_from_iter ( tcx. resolutions ( ( ) ) . stripped_cfg_items . steal ( ) )
561560}
562561
562+ fn resolutions ( tcx : TyCtxt < ' _ > , _: ( ) ) -> & ty:: ResolverGlobalCtxt {
563+ tcx. resolver_for_lowering ( ( ) ) . 1
564+ }
565+
563566pub ( crate ) fn write_dep_info ( tcx : TyCtxt < ' _ > ) {
564567 // Make sure name resolution and macro expansion is run for
565568 // the side-effect of providing a complete set of all
@@ -615,6 +618,7 @@ pub static DEFAULT_QUERY_PROVIDERS: LazyLock<Providers> = LazyLock::new(|| {
615618 providers. hir_crate = rustc_ast_lowering:: lower_to_hir;
616619 providers. resolver_for_lowering = resolver_for_lowering;
617620 providers. stripped_cfg_items = stripped_cfg_items;
621+ providers. resolutions = resolutions;
618622 providers. early_lint_checks = early_lint_checks;
619623 proc_macro_decls:: provide ( providers) ;
620624 rustc_const_eval:: provide ( providers) ;
0 commit comments