@@ -58,9 +58,9 @@ impl<T> DelegationGenerics<T> {
5858}
5959
6060impl < ' hir > HirOrAstGenerics < ' hir > {
61- pub ( super ) fn into_hir_generics (
61+ pub ( super ) fn into_hir_generics < R : ResolverAstLoweringExt < ' hir > > (
6262 & mut self ,
63- ctx : & mut LoweringContext < ' _ , ' _ , ' hir > ,
63+ ctx : & mut LoweringContext < ' _ , ' hir , R > ,
6464 item_id : NodeId ,
6565 span : Span ,
6666 ) -> & mut HirOrAstGenerics < ' hir > {
@@ -98,9 +98,9 @@ impl<'hir> HirOrAstGenerics<'hir> {
9898 }
9999 }
100100
101- pub ( super ) fn into_generic_args (
101+ pub ( super ) fn into_generic_args < R : ResolverAstLoweringExt < ' hir > > (
102102 & self ,
103- ctx : & mut LoweringContext < ' _ , ' _ , ' hir > ,
103+ ctx : & mut LoweringContext < ' _ , ' hir , R > ,
104104 add_lifetimes : bool ,
105105 span : Span ,
106106 ) -> Option < & ' hir hir:: GenericArgs < ' hir > > {
@@ -136,11 +136,11 @@ impl<'a> GenericsGenerationResult<'a> {
136136}
137137
138138impl < ' hir > GenericsGenerationResults < ' hir > {
139- pub ( super ) fn all_params (
139+ pub ( super ) fn all_params < R : ResolverAstLoweringExt < ' hir > > (
140140 & mut self ,
141141 item_id : NodeId ,
142142 span : Span ,
143- ctx : & mut LoweringContext < ' _ , ' _ , ' hir > ,
143+ ctx : & mut LoweringContext < ' _ , ' hir , R > ,
144144 ) -> impl Iterator < Item = hir:: GenericParam < ' hir > > {
145145 // Now we always call `into_hir_generics` both on child and parent,
146146 // however in future we would not do that, when scenarios like
@@ -178,11 +178,11 @@ impl<'hir> GenericsGenerationResults<'hir> {
178178 /// and `generate_lifetime_predicate` functions) we need to add them to delegation generics.
179179 /// Those predicates will not affect resulting predicate inheritance and folding
180180 /// in `rustc_hir_analysis`, as we inherit all predicates from delegation signature.
181- pub ( super ) fn all_predicates (
181+ pub ( super ) fn all_predicates < R : ResolverAstLoweringExt < ' hir > > (
182182 & mut self ,
183183 item_id : NodeId ,
184184 span : Span ,
185- ctx : & mut LoweringContext < ' _ , ' _ , ' hir > ,
185+ ctx : & mut LoweringContext < ' _ , ' hir , R > ,
186186 ) -> impl Iterator < Item = hir:: WherePredicate < ' hir > > {
187187 // Now we always call `into_hir_generics` both on child and parent,
188188 // however in future we would not do that, when scenarios like
@@ -207,7 +207,7 @@ impl<'hir> GenericsGenerationResults<'hir> {
207207 }
208208}
209209
210- impl < ' hir > LoweringContext < ' _ , ' _ , ' hir > {
210+ impl < ' hir , R : ResolverAstLoweringExt < ' hir > > LoweringContext < ' _ , ' hir , R > {
211211 pub ( super ) fn lower_delegation_generics (
212212 & mut self ,
213213 delegation : & Delegation ,
@@ -289,22 +289,22 @@ impl<'hir> LoweringContext<'_, '_, 'hir> {
289289
290290 // Note that we use self.disambiguator here, if we will create new every time
291291 // we will get ICE if params have the same name.
292- self . resolver . mut_part . node_id_to_def_id . insert (
293- p . id ,
294- self . tcx
295- . create_def (
296- self . resolver . def_id ( item_id ) . unwrap ( ) ,
297- Some ( p . ident . name ) ,
298- match p . kind {
299- GenericParamKind :: Lifetime => DefKind :: LifetimeParam ,
300- GenericParamKind :: Type { .. } => DefKind :: TyParam ,
301- GenericParamKind :: Const { .. } => DefKind :: ConstParam ,
302- } ,
303- None ,
304- & mut self . disambiguator ,
305- )
306- . def_id ( ) ,
307- ) ;
292+ let def_id = self
293+ . tcx
294+ . create_def (
295+ self . resolver . def_id ( item_id ) . unwrap ( ) ,
296+ Some ( p . ident . name ) ,
297+ match p . kind {
298+ GenericParamKind :: Lifetime => DefKind :: LifetimeParam ,
299+ GenericParamKind :: Type { .. } => DefKind :: TyParam ,
300+ GenericParamKind :: Const { .. } => DefKind :: ConstParam ,
301+ } ,
302+ None ,
303+ & mut self . disambiguator ,
304+ )
305+ . def_id ( ) ;
306+
307+ self . resolver . insert_new_def_id ( p . id , def_id ) ;
308308 }
309309
310310 // Fallback to default generic param lowering, we modified them in the loop above.
@@ -509,7 +509,7 @@ impl<'hir> LoweringContext<'_, '_, 'hir> {
509509
510510 let node_id = self . next_node_id ( ) ;
511511
512- self . resolver . mut_part . partial_res_map . insert ( node_id, hir:: def:: PartialRes :: new ( res) ) ;
512+ self . resolver . insert_partial_res ( node_id, hir:: def:: PartialRes :: new ( res) ) ;
513513
514514 GenericParamKind :: Const {
515515 ty : Box :: new ( Ty {
0 commit comments