@@ -44,7 +44,7 @@ use rustc_middle::span_bug;
4444use rustc_middle:: ty:: { self , DefIdTree , MainDefinition , RegisteredTools , TyCtxt } ;
4545use rustc_middle:: ty:: { ResolverGlobalCtxt , ResolverOutputs } ;
4646use rustc_query_system:: ich:: StableHashingContext ;
47- use rustc_session:: cstore:: { CrateStore , Untracked } ;
47+ use rustc_session:: cstore:: CrateStore ;
4848use rustc_session:: lint:: LintBuffer ;
4949use rustc_span:: hygiene:: { ExpnId , LocalExpnId , MacroKind , SyntaxContext , Transparency } ;
5050use rustc_span:: source_map:: Spanned ;
@@ -1113,27 +1113,10 @@ impl<'a, 'tcx> AsMut<Resolver<'a, 'tcx>> for Resolver<'a, 'tcx> {
11131113 }
11141114}
11151115
1116- /// A minimal subset of resolver that can implemenent `DefIdTree`, sometimes
1117- /// required to satisfy borrow checker by avoiding borrowing the whole resolver.
1118- #[ derive( Clone , Copy ) ]
1119- struct ResolverTree < ' a > ( & ' a Untracked ) ;
1120-
1121- impl DefIdTree for ResolverTree < ' _ > {
1122- #[ inline]
1123- fn opt_parent ( self , id : DefId ) -> Option < DefId > {
1124- let ResolverTree ( Untracked { definitions, cstore, .. } ) = self ;
1125- match id. as_local ( ) {
1126- Some ( id) => definitions. read ( ) . def_key ( id) . parent ,
1127- None => cstore. read ( ) . as_any ( ) . downcast_ref :: < CStore > ( ) . unwrap ( ) . def_key ( id) . parent ,
1128- }
1129- . map ( |index| DefId { index, ..id } )
1130- }
1131- }
1132-
11331116impl < ' a , ' b , ' tcx > DefIdTree for & ' a Resolver < ' b , ' tcx > {
11341117 #[ inline]
11351118 fn opt_parent ( self , id : DefId ) -> Option < DefId > {
1136- ResolverTree ( & self . tcx . untracked ( ) ) . opt_parent ( id)
1119+ self . tcx . opt_parent ( id)
11371120 }
11381121}
11391122
0 commit comments