@@ -137,12 +137,13 @@ impl<'a, 'b> PathLoweringContext<'a, 'b> {
137137 ty : Ty ,
138138 // We need the original resolution to lower `Self::AssocTy` correctly
139139 res : Option < TypeNs > ,
140+ infer_args : bool ,
140141 ) -> ( Ty , Option < TypeNs > ) {
141142 match self . segments . len ( ) - self . current_segment_idx {
142143 0 => ( ty, res) ,
143144 1 => {
144145 // resolve unselected assoc types
145- ( self . select_associated_type ( res) , None )
146+ ( self . select_associated_type ( res, infer_args ) , None )
146147 }
147148 _ => {
148149 // FIXME report error (ambiguous associated type)
@@ -182,7 +183,7 @@ impl<'a, 'b> PathLoweringContext<'a, 'b> {
182183 // this point (`trait_ref.substitution`).
183184 let substitution = self . substs_from_path_segment (
184185 associated_ty. into ( ) ,
185- false ,
186+ infer_args ,
186187 None ,
187188 true ,
188189 ) ;
@@ -277,7 +278,7 @@ impl<'a, 'b> PathLoweringContext<'a, 'b> {
277278 } ;
278279
279280 self . skip_resolved_segment ( ) ;
280- self . lower_ty_relative_path ( ty, Some ( resolution) )
281+ self . lower_ty_relative_path ( ty, Some ( resolution) , infer_args )
281282 }
282283
283284 fn handle_type_ns_resolution ( & mut self , resolution : & TypeNs ) {
@@ -473,7 +474,7 @@ impl<'a, 'b> PathLoweringContext<'a, 'b> {
473474 Some ( res)
474475 }
475476
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 {
477478 let Some ( res) = res else {
478479 return TyKind :: Error . intern ( Interner ) ;
479480 } ;
@@ -507,7 +508,8 @@ impl<'a, 'b> PathLoweringContext<'a, 'b> {
507508 // generic params. It's inefficient to splice the `Substitution`s, so we may want
508509 // that method to optionally take parent `Substitution` as we already know them at
509510 // 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 ) ;
511513
512514 let substs = Substitution :: from_iter (
513515 Interner ,
0 commit comments