File tree 5 files changed +9
-12
lines changed
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(
416
416
417
417
pub fn lower_to_hir ( tcx : TyCtxt < ' _ > , ( ) : ( ) ) -> hir:: Crate < ' _ > {
418
418
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 ( ) ;
421
420
422
421
let ast_index = index_crate ( & resolver. node_id_to_def_id , & krate) ;
423
422
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>(
818
818
arena,
819
819
hir_arena,
820
820
untracked,
821
- krate,
822
821
dep_graph,
823
822
queries. on_disk_cache . as_ref ( ) . map ( OnDiskCache :: as_dyn) ,
824
823
queries. as_dyn ( ) ,
@@ -831,7 +830,9 @@ pub fn create_global_ctxt<'tcx>(
831
830
let mut qcx = QueryContext { gcx } ;
832
831
qcx. enter ( |tcx| {
833
832
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
+ ) ;
835
836
feed. resolutions ( tcx. arena . alloc ( untracked_resolutions) ) ;
836
837
let feed = tcx. feed_local_crate ( ) ;
837
838
feed. crate_name ( crate_name) ;
Original file line number Diff line number Diff line change @@ -30,7 +30,10 @@ macro_rules! arena_types {
30
30
[ decode] typeck_results: rustc_middle:: ty:: TypeckResults <' tcx>,
31
31
[ decode] borrowck_result:
32
32
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
+ ) >,
34
37
[ ] resolutions: rustc_middle:: ty:: ResolverGlobalCtxt ,
35
38
[ decode] unsafety_check_result: rustc_middle:: mir:: UnsafetyCheckResult ,
36
39
[ decode] code_region: rustc_middle:: mir:: coverage:: CodeRegion ,
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ rustc_queries! {
32
32
desc { "getting the resolver outputs" }
33
33
}
34
34
35
- query resolver_for_lowering( _: ( ) ) -> & ' tcx Steal <ty:: ResolverAstLowering > {
35
+ query resolver_for_lowering( _: ( ) ) -> & ' tcx Steal <( ty:: ResolverAstLowering , Lrc <ast :: Crate > ) > {
36
36
feedable
37
37
no_hash
38
38
desc { "getting the resolver for lowering" }
Original file line number Diff line number Diff line change @@ -432,10 +432,6 @@ pub struct GlobalCtxt<'tcx> {
432
432
433
433
untracked : Untracked ,
434
434
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
-
439
435
/// This provides access to the incremental compilation on-disk cache for query results.
440
436
/// Do not access this directly. It is only meant to be used by
441
437
/// `DepGraph::try_mark_green()` and the query infrastructure.
@@ -591,7 +587,6 @@ impl<'tcx> TyCtxt<'tcx> {
591
587
arena : & ' tcx WorkerLocal < Arena < ' tcx > > ,
592
588
hir_arena : & ' tcx WorkerLocal < hir:: Arena < ' tcx > > ,
593
589
untracked : Untracked ,
594
- krate : Lrc < ast:: Crate > ,
595
590
dep_graph : DepGraph ,
596
591
on_disk_cache : Option < & ' tcx dyn OnDiskCache < ' tcx > > ,
597
592
queries : & ' tcx dyn query:: QueryEngine < ' tcx > ,
@@ -618,7 +613,6 @@ impl<'tcx> TyCtxt<'tcx> {
618
613
lifetimes : common_lifetimes,
619
614
consts : common_consts,
620
615
untracked,
621
- untracked_crate : Steal :: new ( krate) ,
622
616
on_disk_cache,
623
617
queries,
624
618
query_caches : query:: QueryCaches :: default ( ) ,
You can’t perform that action at this time.
0 commit comments