@@ -282,7 +282,7 @@ fn configure_and_expand(
282
282
283
283
fn early_lint_checks ( tcx : TyCtxt < ' _ > , ( ) : ( ) ) {
284
284
let sess = tcx. sess ;
285
- let ( resolver, krate) = & * tcx. resolver_for_lowering ( ( ) ) . borrow ( ) ;
285
+ let ( resolver, krate) = & * tcx. resolver_for_lowering ( ( ) ) . 0 . borrow ( ) ;
286
286
let mut lint_buffer = resolver. lint_buffer . steal ( ) ;
287
287
288
288
if sess. opts . unstable_opts . input_stats {
@@ -536,7 +536,7 @@ fn write_out_deps(tcx: TyCtxt<'_>, outputs: &OutputFilenames, out_filenames: &[P
536
536
fn resolver_for_lowering < ' tcx > (
537
537
tcx : TyCtxt < ' tcx > ,
538
538
( ) : ( ) ,
539
- ) -> & ' tcx Steal < ( ty:: ResolverAstLowering , Lrc < ast:: Crate > ) > {
539
+ ) -> ( & ' tcx Steal < ( ty:: ResolverAstLowering , Lrc < ast:: Crate > ) > , & ' tcx ty :: ResolverGlobalCtxt ) {
540
540
let arenas = Resolver :: arenas ( ) ;
541
541
let _ = tcx. registered_tools ( ( ) ) ; // Uses `crate_for_resolver`.
542
542
let ( krate, pre_configured_attrs) = tcx. crate_for_resolver ( ( ) ) . steal ( ) ;
@@ -551,15 +551,18 @@ fn resolver_for_lowering<'tcx>(
551
551
ast_lowering : untracked_resolver_for_lowering,
552
552
} = resolver. into_outputs ( ) ;
553
553
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)
557
556
}
558
557
559
- fn stripped_cfg_items ( tcx : TyCtxt < ' _ > , _: LocalCrate ) -> & ' _ [ StrippedCfgItem ] {
558
+ fn stripped_cfg_items ( tcx : TyCtxt < ' _ > , _: LocalCrate ) -> & [ StrippedCfgItem ] {
560
559
tcx. arena . alloc_from_iter ( tcx. resolutions ( ( ) ) . stripped_cfg_items . steal ( ) )
561
560
}
562
561
562
+ fn resolutions ( tcx : TyCtxt < ' _ > , _: ( ) ) -> & ty:: ResolverGlobalCtxt {
563
+ tcx. resolver_for_lowering ( ( ) ) . 1
564
+ }
565
+
563
566
pub ( crate ) fn write_dep_info ( tcx : TyCtxt < ' _ > ) {
564
567
// Make sure name resolution and macro expansion is run for
565
568
// the side-effect of providing a complete set of all
@@ -615,6 +618,7 @@ pub static DEFAULT_QUERY_PROVIDERS: LazyLock<Providers> = LazyLock::new(|| {
615
618
providers. hir_crate = rustc_ast_lowering:: lower_to_hir;
616
619
providers. resolver_for_lowering = resolver_for_lowering;
617
620
providers. stripped_cfg_items = stripped_cfg_items;
621
+ providers. resolutions = resolutions;
618
622
providers. early_lint_checks = early_lint_checks;
619
623
proc_macro_decls:: provide ( providers) ;
620
624
rustc_const_eval:: provide ( providers) ;
0 commit comments