@@ -137,12 +137,13 @@ impl<'a, 'b> PathLoweringContext<'a, 'b> {
137
137
ty : Ty ,
138
138
// We need the original resolution to lower `Self::AssocTy` correctly
139
139
res : Option < TypeNs > ,
140
+ infer_args : bool ,
140
141
) -> ( Ty , Option < TypeNs > ) {
141
142
match self . segments . len ( ) - self . current_segment_idx {
142
143
0 => ( ty, res) ,
143
144
1 => {
144
145
// resolve unselected assoc types
145
- ( self . select_associated_type ( res) , None )
146
+ ( self . select_associated_type ( res, infer_args ) , None )
146
147
}
147
148
_ => {
148
149
// FIXME report error (ambiguous associated type)
@@ -182,7 +183,7 @@ impl<'a, 'b> PathLoweringContext<'a, 'b> {
182
183
// this point (`trait_ref.substitution`).
183
184
let substitution = self . substs_from_path_segment (
184
185
associated_ty. into ( ) ,
185
- false ,
186
+ infer_args ,
186
187
None ,
187
188
true ,
188
189
) ;
@@ -277,7 +278,7 @@ impl<'a, 'b> PathLoweringContext<'a, 'b> {
277
278
} ;
278
279
279
280
self . skip_resolved_segment ( ) ;
280
- self . lower_ty_relative_path ( ty, Some ( resolution) )
281
+ self . lower_ty_relative_path ( ty, Some ( resolution) , infer_args )
281
282
}
282
283
283
284
fn handle_type_ns_resolution ( & mut self , resolution : & TypeNs ) {
@@ -473,7 +474,7 @@ impl<'a, 'b> PathLoweringContext<'a, 'b> {
473
474
Some ( res)
474
475
}
475
476
476
- fn select_associated_type ( & mut self , res : Option < TypeNs > ) -> Ty {
477
+ fn select_associated_type ( & mut self , res : Option < TypeNs > , infer_args : bool ) -> Ty {
477
478
let Some ( res) = res else {
478
479
return TyKind :: Error . intern ( Interner ) ;
479
480
} ;
@@ -507,7 +508,8 @@ impl<'a, 'b> PathLoweringContext<'a, 'b> {
507
508
// generic params. It's inefficient to splice the `Substitution`s, so we may want
508
509
// that method to optionally take parent `Substitution` as we already know them at
509
510
// this point (`t.substitution`).
510
- let substs = self . substs_from_path_segment ( associated_ty. into ( ) , false , None , true ) ;
511
+ let substs =
512
+ self . substs_from_path_segment ( associated_ty. into ( ) , infer_args, None , true ) ;
511
513
512
514
let substs = Substitution :: from_iter (
513
515
Interner ,
0 commit comments