@@ -51,16 +51,16 @@ use rustc_hir as hir;
5151use rustc_hir:: attrs:: { AttributeKind , InlineAttr } ;
5252use rustc_hir:: def_id:: { DefId , LocalDefId } ;
5353use rustc_middle:: span_bug;
54- use rustc_middle:: ty:: { Asyncness , DelegationAttrs , DelegationFnSigAttrs , ResolverAstLowering } ;
54+ use rustc_middle:: ty:: { Asyncness , DelegationAttrs , DelegationFnSigAttrs } ;
5555use rustc_span:: symbol:: kw;
5656use rustc_span:: { DUMMY_SP , Ident , Span , Symbol } ;
5757use smallvec:: SmallVec ;
5858
5959use crate :: delegation:: generics:: { GenericsGenerationResult , GenericsGenerationResults } ;
6060use crate :: errors:: { CycleInDelegationSignatureResolution , UnresolvedDelegationCallee } ;
6161use crate :: {
62- AllowReturnTypeNotation , GenericArgsMode , ImplTraitContext , ImplTraitPosition , LoweringContext ,
63- ParamMode , ResolverAstLoweringExt ,
62+ AllowReturnTypeNotation , CombinedResolverAstLowering , GenericArgsMode , ImplTraitContext ,
63+ ImplTraitPosition , LoweringContext , ParamMode , ResolverAstLoweringExt ,
6464} ;
6565
6666mod generics;
@@ -134,16 +134,14 @@ impl DelegationIds {
134134 }
135135}
136136
137- impl < ' hir > LoweringContext < ' _ , ' hir > {
137+ impl < ' hir > LoweringContext < ' _ , ' _ , ' hir > {
138138 fn is_method ( & self , def_id : DefId , span : Span ) -> bool {
139139 match self . tcx . def_kind ( def_id) {
140140 DefKind :: Fn => false ,
141141 DefKind :: AssocFn => match def_id. as_local ( ) {
142- Some ( local_def_id) => self
143- . resolver
144- . delegation_fn_sigs
145- . get ( & local_def_id)
146- . is_some_and ( |sig| sig. has_self ) ,
142+ Some ( local_def_id) => {
143+ self . resolver . delegation_fn_sig ( local_def_id) . is_some_and ( |sig| sig. has_self )
144+ }
147145 None => self . tcx . associated_item ( def_id) . is_method ( ) ,
148146 } ,
149147 _ => span_bug ! ( span, "unexpected DefKind for delegation item" ) ,
@@ -159,7 +157,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
159157
160158 // Delegation can be unresolved in illegal places such as function bodies in extern blocks (see #151356)
161159 let ids = if let Some ( delegation_info) =
162- self . resolver . delegation_infos . get ( & self . local_def_id ( item_id) )
160+ self . resolver . delegation_info ( self . local_def_id ( item_id) )
163161 {
164162 self . get_delegation_ids ( delegation_info. resolution_node , span)
165163 } else {
@@ -344,10 +342,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
344342
345343 fn get_attrs ( & self , local_id : LocalDefId ) -> & DelegationAttrs {
346344 // local_id can correspond either to a function or other delegation
347- if let Some ( fn_sig) = self . resolver . delegation_fn_sigs . get ( & local_id) {
345+ if let Some ( fn_sig) = self . resolver . delegation_fn_sig ( local_id) {
348346 & fn_sig. attrs
349347 } else {
350- & self . resolver . delegation_infos [ & local_id] . attrs
348+ & self . resolver . delegation_info ( local_id) . unwrap ( ) . attrs
351349 }
352350 }
353351
@@ -378,7 +376,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
378376 // it means that we refer to another delegation as a callee, so in order to obtain
379377 // a signature DefId we obtain NodeId of the callee delegation and try to get signature from it.
380378 if let Some ( local_id) = def_id. as_local ( )
381- && let Some ( delegation_info) = self . resolver . delegation_infos . get ( & local_id)
379+ && let Some ( delegation_info) = self . resolver . delegation_info ( local_id)
382380 {
383381 node_id = delegation_info. resolution_node ;
384382 if visited. contains ( & node_id) {
@@ -402,7 +400,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
402400 // Function parameter count, including C variadic `...` if present.
403401 fn param_count ( & self , def_id : DefId ) -> ( usize , bool /*c_variadic*/ ) {
404402 if let Some ( local_sig_id) = def_id. as_local ( ) {
405- match self . resolver . delegation_fn_sigs . get ( & local_sig_id) {
403+ match self . resolver . delegation_fn_sig ( local_sig_id) {
406404 Some ( sig) => ( sig. param_count , sig. c_variadic ) ,
407405 None => ( 0 , false ) ,
408406 }
@@ -457,7 +455,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
457455 span : Span ,
458456 ) -> hir:: FnSig < ' hir > {
459457 let header = if let Some ( local_sig_id) = sig_id. as_local ( ) {
460- match self . resolver . delegation_fn_sigs . get ( & local_sig_id) {
458+ match self . resolver . delegation_fn_sig ( local_sig_id) {
461459 Some ( sig) => {
462460 let parent = self . tcx . parent ( sig_id) ;
463461 // HACK: we override the default safety instead of generating attributes from the ether.
@@ -816,25 +814,25 @@ impl<'hir> LoweringContext<'_, 'hir> {
816814 }
817815}
818816
819- struct SelfResolver < ' a , ' tcx > {
820- resolver : & ' a mut ResolverAstLowering < ' tcx > ,
817+ struct SelfResolver < ' a , ' b , ' tcx > {
818+ resolver : & ' a mut CombinedResolverAstLowering < ' b , ' tcx > ,
821819 path_id : NodeId ,
822820 self_param_id : NodeId ,
823821}
824822
825- impl SelfResolver < ' _ , ' _ > {
823+ impl SelfResolver < ' _ , ' _ , ' _ > {
826824 fn try_replace_id ( & mut self , id : NodeId ) {
827- if let Some ( res) = self . resolver . partial_res_map . get ( & id)
825+ if let Some ( res) = self . resolver . get_partial_res ( id)
828826 && let Some ( Res :: Local ( sig_id) ) = res. full_res ( )
829827 && sig_id == self . path_id
830828 {
831829 let new_res = PartialRes :: new ( Res :: Local ( self . self_param_id ) ) ;
832- self . resolver . partial_res_map . insert ( id, new_res) ;
830+ self . resolver . mut_part . partial_res_map . insert ( id, new_res) ;
833831 }
834832 }
835833}
836834
837- impl < ' ast , ' a > Visitor < ' ast > for SelfResolver < ' a , ' _ > {
835+ impl < ' ast , ' a > Visitor < ' ast > for SelfResolver < ' a , ' _ , ' _ > {
838836 fn visit_id ( & mut self , id : NodeId ) {
839837 self . try_replace_id ( id) ;
840838 }
0 commit comments