@@ -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 ,
6464} ;
6565
6666mod generics;
@@ -134,13 +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 ( ) {
142142 Some ( local_def_id) => self
143143 . resolver
144+ . base
144145 . delegation_fn_sigs
145146 . get ( & local_def_id)
146147 . is_some_and ( |sig| sig. has_self ) ,
@@ -159,7 +160,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
159160
160161 // Delegation can be unresolved in illegal places such as function bodies in extern blocks (see #151356)
161162 let ids = if let Some ( delegation_info) =
162- self . resolver . delegation_infos . get ( & self . local_def_id ( item_id) )
163+ self . resolver . base . delegation_infos . get ( & self . local_def_id ( item_id) )
163164 {
164165 self . get_delegation_ids ( delegation_info. resolution_node , span)
165166 } else {
@@ -344,10 +345,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
344345
345346 fn get_attrs ( & self , local_id : LocalDefId ) -> & DelegationAttrs {
346347 // 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) {
348+ if let Some ( fn_sig) = self . resolver . base . delegation_fn_sigs . get ( & local_id) {
348349 & fn_sig. attrs
349350 } else {
350- & self . resolver . delegation_infos [ & local_id] . attrs
351+ & self . resolver . base . delegation_infos [ & local_id] . attrs
351352 }
352353 }
353354
@@ -378,7 +379,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
378379 // it means that we refer to another delegation as a callee, so in order to obtain
379380 // a signature DefId we obtain NodeId of the callee delegation and try to get signature from it.
380381 if let Some ( local_id) = def_id. as_local ( )
381- && let Some ( delegation_info) = self . resolver . delegation_infos . get ( & local_id)
382+ && let Some ( delegation_info) = self . resolver . base . delegation_infos . get ( & local_id)
382383 {
383384 node_id = delegation_info. resolution_node ;
384385 if visited. contains ( & node_id) {
@@ -402,7 +403,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
402403 // Function parameter count, including C variadic `...` if present.
403404 fn param_count ( & self , def_id : DefId ) -> ( usize , bool /*c_variadic*/ ) {
404405 if let Some ( local_sig_id) = def_id. as_local ( ) {
405- match self . resolver . delegation_fn_sigs . get ( & local_sig_id) {
406+ match self . resolver . base . delegation_fn_sigs . get ( & local_sig_id) {
406407 Some ( sig) => ( sig. param_count , sig. c_variadic ) ,
407408 None => ( 0 , false ) ,
408409 }
@@ -457,7 +458,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
457458 span : Span ,
458459 ) -> hir:: FnSig < ' hir > {
459460 let header = if let Some ( local_sig_id) = sig_id. as_local ( ) {
460- match self . resolver . delegation_fn_sigs . get ( & local_sig_id) {
461+ match self . resolver . base . delegation_fn_sigs . get ( & local_sig_id) {
461462 Some ( sig) => {
462463 let parent = self . tcx . parent ( sig_id) ;
463464 // HACK: we override the default safety instead of generating attributes from the ether.
@@ -816,25 +817,25 @@ impl<'hir> LoweringContext<'_, 'hir> {
816817 }
817818}
818819
819- struct SelfResolver < ' a , ' tcx > {
820- resolver : & ' a mut ResolverAstLowering < ' tcx > ,
820+ struct SelfResolver < ' a , ' b , ' tcx > {
821+ resolver : & ' a mut CombinedResolverAstLowering < ' b , ' tcx > ,
821822 path_id : NodeId ,
822823 self_param_id : NodeId ,
823824}
824825
825- impl SelfResolver < ' _ , ' _ > {
826+ impl SelfResolver < ' _ , ' _ , ' _ > {
826827 fn try_replace_id ( & mut self , id : NodeId ) {
827- if let Some ( res) = self . resolver . partial_res_map . get ( & id)
828+ if let Some ( res) = self . resolver . get_partial_res ( id)
828829 && let Some ( Res :: Local ( sig_id) ) = res. full_res ( )
829830 && sig_id == self . path_id
830831 {
831832 let new_res = PartialRes :: new ( Res :: Local ( self . self_param_id ) ) ;
832- self . resolver . partial_res_map . insert ( id, new_res) ;
833+ self . resolver . mut_part . partial_res_map . insert ( id, new_res) ;
833834 }
834835 }
835836}
836837
837- impl < ' ast , ' a > Visitor < ' ast > for SelfResolver < ' a , ' _ > {
838+ impl < ' ast , ' a > Visitor < ' ast > for SelfResolver < ' a , ' _ , ' _ > {
838839 fn visit_id ( & mut self , id : NodeId ) {
839840 self . try_replace_id ( id) ;
840841 }
0 commit comments