@@ -310,8 +310,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
310
310
def_id,
311
311
& [ ] ,
312
312
item_segment,
313
- item_segment. args ( ) ,
314
- item_segment. infer_args ,
315
313
None ,
316
314
ty:: BoundConstness :: NotConst ,
317
315
) ;
@@ -355,14 +353,12 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
355
353
/// type itself: `['a]`. The returned `GenericArgsRef` concatenates these two
356
354
/// lists: `[Vec<u8>, u8, 'a]`.
357
355
#[ instrument( level = "debug" , skip( self , span) , ret) ]
358
- fn lower_generic_args_of_path < ' a > (
356
+ fn lower_generic_args_of_path (
359
357
& self ,
360
358
span : Span ,
361
359
def_id : DefId ,
362
360
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 > ,
366
362
self_ty : Option < Ty < ' tcx > > ,
367
363
constness : ty:: BoundConstness ,
368
364
) -> ( GenericArgsRef < ' tcx > , GenericArgCountResult ) {
@@ -390,12 +386,10 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
390
386
let mut arg_count = check_generic_arg_count (
391
387
tcx,
392
388
def_id,
393
- seg ,
389
+ segment ,
394
390
generics,
395
- generic_args,
396
391
GenericArgPosition :: Type ,
397
392
self_ty. is_some ( ) ,
398
- infer_args,
399
393
) ;
400
394
401
395
if let Err ( err) = & arg_count. correct
@@ -570,9 +564,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
570
564
lowerer : self ,
571
565
def_id,
572
566
span,
573
- generic_args,
567
+ generic_args : segment . args ( ) ,
574
568
inferred_params : vec ! [ ] ,
575
- infer_args,
569
+ infer_args : segment . infer_args ,
576
570
} ;
577
571
if let ty:: BoundConstness :: Const | ty:: BoundConstness :: ConstIfConst = constness
578
572
&& generics. has_self
@@ -613,8 +607,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
613
607
item_def_id,
614
608
parent_args,
615
609
item_segment,
616
- item_segment. args ( ) ,
617
- item_segment. infer_args ,
618
610
None ,
619
611
ty:: BoundConstness :: NotConst ,
620
612
) ;
@@ -683,8 +675,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
683
675
) -> GenericArgCountResult {
684
676
let trait_def_id = trait_ref. trait_def_id ( ) . unwrap_or_else ( || FatalError . raise ( ) ) ;
685
677
let trait_segment = trait_ref. path . segments . last ( ) . unwrap ( ) ;
686
- let args = trait_segment. args ( ) ;
687
-
688
678
self . prohibit_generic_args ( trait_ref. path . segments . split_last ( ) . unwrap ( ) . 1 . iter ( ) , |_| { } ) ;
689
679
self . complain_about_internal_fn_trait ( span, trait_def_id, trait_segment, false ) ;
690
680
@@ -693,8 +683,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
693
683
trait_def_id,
694
684
& [ ] ,
695
685
trait_segment,
696
- args,
697
- trait_segment. infer_args ,
698
686
Some ( self_ty) ,
699
687
constness,
700
688
) ;
@@ -712,7 +700,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
712
700
bounds. push_trait_bound ( tcx, poly_trait_ref, span, polarity) ;
713
701
714
702
let mut dup_bindings = FxIndexMap :: default ( ) ;
715
- for binding in args. bindings {
703
+ for binding in trait_segment . args ( ) . bindings {
716
704
// Don't register additional associated type bounds for negative bounds,
717
705
// since we should have emitten an error for them earlier, and they will
718
706
// not be well-formed!
@@ -758,8 +746,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
758
746
trait_def_id,
759
747
& [ ] ,
760
748
trait_segment,
761
- trait_segment. args ( ) ,
762
- trait_segment. infer_args ,
763
749
Some ( self_ty) ,
764
750
constness,
765
751
) ;
@@ -2493,8 +2479,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
2493
2479
def_id,
2494
2480
& [ ] ,
2495
2481
& hir:: PathSegment :: invalid ( ) ,
2496
- & GenericArgs :: none ( ) ,
2497
- true ,
2498
2482
None ,
2499
2483
ty:: BoundConstness :: NotConst ,
2500
2484
) ;
0 commit comments