File tree Expand file tree Collapse file tree 5 files changed +9
-12
lines changed Expand file tree Collapse file tree 5 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -416,8 +416,7 @@ fn compute_hir_hash(
416416
417417pub fn lower_to_hir ( tcx : TyCtxt < ' _ > , ( ) : ( ) ) -> hir:: Crate < ' _ > {
418418 let sess = tcx. sess ;
419- let krate = tcx. untracked_crate . steal ( ) ;
420- let mut resolver = tcx. resolver_for_lowering ( ( ) ) . steal ( ) ;
419+ let ( mut resolver, krate) = tcx. resolver_for_lowering ( ( ) ) . steal ( ) ;
421420
422421 let ast_index = index_crate ( & resolver. node_id_to_def_id , & krate) ;
423422 let mut owners = IndexVec :: from_fn_n (
Original file line number Diff line number Diff line change @@ -818,7 +818,6 @@ pub fn create_global_ctxt<'tcx>(
818818 arena,
819819 hir_arena,
820820 untracked,
821- krate,
822821 dep_graph,
823822 queries. on_disk_cache . as_ref ( ) . map ( OnDiskCache :: as_dyn) ,
824823 queries. as_dyn ( ) ,
@@ -831,7 +830,9 @@ pub fn create_global_ctxt<'tcx>(
831830 let mut qcx = QueryContext { gcx } ;
832831 qcx. enter ( |tcx| {
833832 let feed = tcx. feed_unit_query ( ) ;
834- feed. resolver_for_lowering ( tcx. arena . alloc ( Steal :: new ( untracked_resolver_for_lowering) ) ) ;
833+ feed. resolver_for_lowering (
834+ tcx. arena . alloc ( Steal :: new ( ( untracked_resolver_for_lowering, krate) ) ) ,
835+ ) ;
835836 feed. resolutions ( tcx. arena . alloc ( untracked_resolutions) ) ;
836837 let feed = tcx. feed_local_crate ( ) ;
837838 feed. crate_name ( crate_name) ;
Original file line number Diff line number Diff line change @@ -30,7 +30,10 @@ macro_rules! arena_types {
3030 [ decode] typeck_results: rustc_middle:: ty:: TypeckResults <' tcx>,
3131 [ decode] borrowck_result:
3232 rustc_middle:: mir:: BorrowCheckResult <' tcx>,
33- [ ] resolver: rustc_data_structures:: steal:: Steal <rustc_middle:: ty:: ResolverAstLowering >,
33+ [ ] resolver: rustc_data_structures:: steal:: Steal <(
34+ rustc_middle:: ty:: ResolverAstLowering ,
35+ rustc_data_structures:: sync:: Lrc <rustc_ast:: Crate >,
36+ ) >,
3437 [ ] resolutions: rustc_middle:: ty:: ResolverGlobalCtxt ,
3538 [ decode] unsafety_check_result: rustc_middle:: mir:: UnsafetyCheckResult ,
3639 [ decode] code_region: rustc_middle:: mir:: coverage:: CodeRegion ,
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ rustc_queries! {
3232 desc { "getting the resolver outputs" }
3333 }
3434
35- query resolver_for_lowering( _: ( ) ) -> & ' tcx Steal <ty:: ResolverAstLowering > {
35+ query resolver_for_lowering( _: ( ) ) -> & ' tcx Steal <( ty:: ResolverAstLowering , Lrc <ast :: Crate > ) > {
3636 feedable
3737 no_hash
3838 desc { "getting the resolver for lowering" }
Original file line number Diff line number Diff line change @@ -432,10 +432,6 @@ pub struct GlobalCtxt<'tcx> {
432432
433433 untracked : Untracked ,
434434
435- /// The entire crate as AST. This field serves as the input for the hir_crate query,
436- /// which lowers it from AST to HIR. It must not be read or used by anything else.
437- pub untracked_crate : Steal < Lrc < ast:: Crate > > ,
438-
439435 /// This provides access to the incremental compilation on-disk cache for query results.
440436 /// Do not access this directly. It is only meant to be used by
441437 /// `DepGraph::try_mark_green()` and the query infrastructure.
@@ -591,7 +587,6 @@ impl<'tcx> TyCtxt<'tcx> {
591587 arena : & ' tcx WorkerLocal < Arena < ' tcx > > ,
592588 hir_arena : & ' tcx WorkerLocal < hir:: Arena < ' tcx > > ,
593589 untracked : Untracked ,
594- krate : Lrc < ast:: Crate > ,
595590 dep_graph : DepGraph ,
596591 on_disk_cache : Option < & ' tcx dyn OnDiskCache < ' tcx > > ,
597592 queries : & ' tcx dyn query:: QueryEngine < ' tcx > ,
@@ -618,7 +613,6 @@ impl<'tcx> TyCtxt<'tcx> {
618613 lifetimes : common_lifetimes,
619614 consts : common_consts,
620615 untracked,
621- untracked_crate : Steal :: new ( krate) ,
622616 on_disk_cache,
623617 queries,
624618 query_caches : query:: QueryCaches :: default ( ) ,
You can’t perform that action at this time.
0 commit comments