@@ -310,8 +310,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
310310 def_id,
311311 & [ ] ,
312312 item_segment,
313- item_segment. args ( ) ,
314- item_segment. infer_args ,
315313 None ,
316314 ty:: BoundConstness :: NotConst ,
317315 ) ;
@@ -355,14 +353,12 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
355353 /// type itself: `['a]`. The returned `GenericArgsRef` concatenates these two
356354 /// lists: `[Vec<u8>, u8, 'a]`.
357355 #[ instrument( level = "debug" , skip( self , span) , ret) ]
358- fn lower_generic_args_of_path < ' a > (
356+ fn lower_generic_args_of_path (
359357 & self ,
360358 span : Span ,
361359 def_id : DefId ,
362360 parent_args : & [ ty:: GenericArg < ' tcx > ] ,
363- seg : & hir:: PathSegment < ' _ > ,
364- generic_args : & ' a hir:: GenericArgs < ' tcx > ,
365- infer_args : bool ,
361+ segment : & hir:: PathSegment < ' tcx > ,
366362 self_ty : Option < Ty < ' tcx > > ,
367363 constness : ty:: BoundConstness ,
368364 ) -> ( GenericArgsRef < ' tcx > , GenericArgCountResult ) {
@@ -390,12 +386,10 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
390386 let mut arg_count = check_generic_arg_count (
391387 tcx,
392388 def_id,
393- seg ,
389+ segment ,
394390 generics,
395- generic_args,
396391 GenericArgPosition :: Type ,
397392 self_ty. is_some ( ) ,
398- infer_args,
399393 ) ;
400394
401395 if let Err ( err) = & arg_count. correct
@@ -570,9 +564,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
570564 lowerer : self ,
571565 def_id,
572566 span,
573- generic_args,
567+ generic_args : segment . args ( ) ,
574568 inferred_params : vec ! [ ] ,
575- infer_args,
569+ infer_args : segment . infer_args ,
576570 } ;
577571 if let ty:: BoundConstness :: Const | ty:: BoundConstness :: ConstIfConst = constness
578572 && generics. has_self
@@ -613,8 +607,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
613607 item_def_id,
614608 parent_args,
615609 item_segment,
616- item_segment. args ( ) ,
617- item_segment. infer_args ,
618610 None ,
619611 ty:: BoundConstness :: NotConst ,
620612 ) ;
@@ -683,8 +675,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
683675 ) -> GenericArgCountResult {
684676 let trait_def_id = trait_ref. trait_def_id ( ) . unwrap_or_else ( || FatalError . raise ( ) ) ;
685677 let trait_segment = trait_ref. path . segments . last ( ) . unwrap ( ) ;
686- let args = trait_segment. args ( ) ;
687-
688678 self . prohibit_generic_args ( trait_ref. path . segments . split_last ( ) . unwrap ( ) . 1 . iter ( ) , |_| { } ) ;
689679 self . complain_about_internal_fn_trait ( span, trait_def_id, trait_segment, false ) ;
690680
@@ -693,8 +683,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
693683 trait_def_id,
694684 & [ ] ,
695685 trait_segment,
696- args,
697- trait_segment. infer_args ,
698686 Some ( self_ty) ,
699687 constness,
700688 ) ;
@@ -712,7 +700,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
712700 bounds. push_trait_bound ( tcx, poly_trait_ref, span, polarity) ;
713701
714702 let mut dup_bindings = FxIndexMap :: default ( ) ;
715- for binding in args. bindings {
703+ for binding in trait_segment . args ( ) . bindings {
716704 // Don't register additional associated type bounds for negative bounds,
717705 // since we should have emitten an error for them earlier, and they will
718706 // not be well-formed!
@@ -758,8 +746,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
758746 trait_def_id,
759747 & [ ] ,
760748 trait_segment,
761- trait_segment. args ( ) ,
762- trait_segment. infer_args ,
763749 Some ( self_ty) ,
764750 constness,
765751 ) ;
@@ -2493,8 +2479,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
24932479 def_id,
24942480 & [ ] ,
24952481 & hir:: PathSegment :: invalid ( ) ,
2496- & GenericArgs :: none ( ) ,
2497- true ,
24982482 None ,
24992483 ty:: BoundConstness :: NotConst ,
25002484 ) ;
0 commit comments