@@ -284,8 +284,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
284
284
def_id,
285
285
& [ ] ,
286
286
item_segment,
287
- item_segment. args ( ) ,
288
- item_segment. infer_args ,
289
287
None ,
290
288
ty:: BoundConstness :: NotConst ,
291
289
) ;
@@ -329,14 +327,12 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
329
327
/// type itself: `['a]`. The returned `GenericArgsRef` concatenates these two
330
328
/// lists: `[Vec<u8>, u8, 'a]`.
331
329
#[ instrument( level = "debug" , skip( self , span) , ret) ]
332
- fn lower_generic_args_of_path < ' a > (
330
+ fn lower_generic_args_of_path (
333
331
& self ,
334
332
span : Span ,
335
333
def_id : DefId ,
336
334
parent_args : & [ ty:: GenericArg < ' tcx > ] ,
337
- seg : & hir:: PathSegment < ' _ > ,
338
- generic_args : & ' a hir:: GenericArgs < ' tcx > ,
339
- infer_args : bool ,
335
+ segment : & hir:: PathSegment < ' tcx > ,
340
336
self_ty : Option < Ty < ' tcx > > ,
341
337
constness : ty:: BoundConstness ,
342
338
) -> ( GenericArgsRef < ' tcx > , GenericArgCountResult ) {
@@ -364,12 +360,10 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
364
360
let mut arg_count = check_generic_arg_count (
365
361
tcx,
366
362
def_id,
367
- seg ,
363
+ segment ,
368
364
generics,
369
- generic_args,
370
365
GenericArgPosition :: Type ,
371
366
self_ty. is_some ( ) ,
372
- infer_args,
373
367
) ;
374
368
375
369
if let Err ( err) = & arg_count. correct
@@ -544,9 +538,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
544
538
lowerer : self ,
545
539
def_id,
546
540
span,
547
- generic_args,
541
+ generic_args : segment . args ( ) ,
548
542
inferred_params : vec ! [ ] ,
549
- infer_args,
543
+ infer_args : segment . infer_args ,
550
544
} ;
551
545
if let ty:: BoundConstness :: Const | ty:: BoundConstness :: ConstIfConst = constness
552
546
&& generics. has_self
@@ -589,8 +583,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
589
583
item_def_id,
590
584
parent_args,
591
585
item_segment,
592
- item_segment. args ( ) ,
593
- item_segment. infer_args ,
594
586
None ,
595
587
ty:: BoundConstness :: NotConst ,
596
588
) ;
@@ -657,8 +649,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
657
649
) -> GenericArgCountResult {
658
650
let trait_def_id = trait_ref. trait_def_id ( ) . unwrap_or_else ( || FatalError . raise ( ) ) ;
659
651
let trait_segment = trait_ref. path . segments . last ( ) . unwrap ( ) ;
660
- let args = trait_segment. args ( ) ;
661
-
662
652
self . prohibit_generic_args ( trait_ref. path . segments . split_last ( ) . unwrap ( ) . 1 . iter ( ) , |_| { } ) ;
663
653
self . complain_about_internal_fn_trait ( span, trait_def_id, trait_segment, false ) ;
664
654
@@ -667,8 +657,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
667
657
trait_def_id,
668
658
& [ ] ,
669
659
trait_segment,
670
- args,
671
- trait_segment. infer_args ,
672
660
Some ( self_ty) ,
673
661
constness,
674
662
) ;
@@ -686,7 +674,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
686
674
bounds. push_trait_bound ( tcx, poly_trait_ref, span, polarity) ;
687
675
688
676
let mut dup_bindings = FxIndexMap :: default ( ) ;
689
- for binding in args. bindings {
677
+ for binding in trait_segment . args ( ) . bindings {
690
678
// Don't register additional associated type bounds for negative bounds,
691
679
// since we should have emitten an error for them earlier, and they will
692
680
// not be well-formed!
@@ -732,8 +720,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
732
720
trait_def_id,
733
721
& [ ] ,
734
722
trait_segment,
735
- trait_segment. args ( ) ,
736
- trait_segment. infer_args ,
737
723
Some ( self_ty) ,
738
724
constness,
739
725
) ;
@@ -2442,8 +2428,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
2442
2428
def_id,
2443
2429
& [ ] ,
2444
2430
& hir:: PathSegment :: invalid ( ) ,
2445
- & GenericArgs :: none ( ) ,
2446
- true ,
2447
2431
None ,
2448
2432
ty:: BoundConstness :: NotConst ,
2449
2433
) ;
0 commit comments