@@ -288,8 +288,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
288288 def_id,
289289 & [ ] ,
290290 item_segment,
291- item_segment. args ( ) ,
292- item_segment. infer_args ,
293291 None ,
294292 ty:: BoundConstness :: NotConst ,
295293 ) ;
@@ -332,14 +330,12 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
332330 /// type itself: `['a]`. The returned `SubstsRef` concatenates these two
333331 /// lists: `[Vec<u8>, u8, 'a]`.
334332 #[ instrument( level = "debug" , skip( self , span) , ret) ]
335- fn create_substs_for_ast_path < ' a > (
333+ fn create_substs_for_ast_path (
336334 & self ,
337335 span : Span ,
338336 def_id : DefId ,
339337 parent_substs : & [ subst:: GenericArg < ' tcx > ] ,
340338 seg : & hir:: PathSegment < ' _ > ,
341- generic_args : & ' a hir:: GenericArgs < ' _ > ,
342- infer_args : bool ,
343339 self_ty : Option < Ty < ' tcx > > ,
344340 constness : ty:: BoundConstness ,
345341 ) -> ( SubstsRef < ' tcx > , GenericArgCountResult ) {
@@ -370,10 +366,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
370366 def_id,
371367 seg,
372368 generics,
373- generic_args,
374369 GenericArgPosition :: Type ,
375370 self_ty. is_some ( ) ,
376- infer_args,
377371 ) ;
378372
379373 // Skip processing if type has no generic parameters.
@@ -540,9 +534,9 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
540534 astconv : self ,
541535 def_id,
542536 span,
543- generic_args,
537+ generic_args : seg . args ( ) ,
544538 inferred_params : vec ! [ ] ,
545- infer_args,
539+ infer_args : seg . infer_args ,
546540 } ;
547541 let substs = create_substs_for_generic_args (
548542 tcx,
@@ -623,8 +617,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
623617 item_def_id,
624618 parent_substs,
625619 item_segment,
626- item_segment. args ( ) ,
627- item_segment. infer_args ,
628620 None ,
629621 ty:: BoundConstness :: NotConst ,
630622 ) ;
@@ -671,17 +663,13 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
671663 trait_ref_span : Span ,
672664 trait_def_id : DefId ,
673665 trait_segment : & hir:: PathSegment < ' _ > ,
674- args : & GenericArgs < ' _ > ,
675- infer_args : bool ,
676666 self_ty : Ty < ' tcx > ,
677667 ) -> GenericArgCountResult {
678668 let ( substs, arg_count) = self . create_substs_for_ast_path (
679669 trait_ref_span,
680670 trait_def_id,
681671 & [ ] ,
682672 trait_segment,
683- args,
684- infer_args,
685673 Some ( self_ty) ,
686674 constness,
687675 ) ;
@@ -690,7 +678,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
690678 let bound_vars = tcx. late_bound_vars ( hir_id) ;
691679 debug ! ( ?bound_vars) ;
692680
693- let assoc_bindings = self . create_assoc_bindings_for_generic_args ( args) ;
681+ let assoc_bindings = self . create_assoc_bindings_for_generic_args ( trait_segment . args ( ) ) ;
694682
695683 let poly_trait_ref =
696684 ty:: Binder :: bind_with_vars ( tcx. mk_trait_ref ( trait_def_id, substs) , bound_vars) ;
@@ -751,8 +739,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
751739 let trait_ref_span = trait_ref. path . span ;
752740 let trait_def_id = trait_ref. trait_def_id ( ) . unwrap_or_else ( || FatalError . raise ( ) ) ;
753741 let trait_segment = trait_ref. path . segments . last ( ) . unwrap ( ) ;
754- let args = trait_segment. args ( ) ;
755- let infer_args = trait_segment. infer_args ;
756742
757743 self . prohibit_generics ( trait_ref. path . segments . split_last ( ) . unwrap ( ) . 1 . iter ( ) , |_| { } ) ;
758744 self . complain_about_internal_fn_trait ( span, trait_def_id, trait_segment, false ) ;
@@ -767,8 +753,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
767753 trait_ref_span,
768754 trait_def_id,
769755 trait_segment,
770- args,
771- infer_args,
772756 self_ty,
773757 )
774758 }
@@ -787,8 +771,13 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
787771 let speculative = false ;
788772 let trait_ref_span = span;
789773 let trait_def_id = self . tcx ( ) . require_lang_item ( lang_item, Some ( span) ) ;
790- let trait_segment = & hir:: PathSegment :: invalid ( ) ;
791- let infer_args = false ;
774+ let trait_segment = & hir:: PathSegment {
775+ ident : Ident :: empty ( ) ,
776+ hir_id : hir:: HirId :: INVALID ,
777+ res : Res :: Err ,
778+ args : Some ( args) ,
779+ infer_args : false ,
780+ } ;
792781
793782 self . instantiate_poly_trait_ref_inner (
794783 hir_id,
@@ -800,8 +789,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
800789 trait_ref_span,
801790 trait_def_id,
802791 trait_segment,
803- args,
804- infer_args,
805792 self_ty,
806793 ) ;
807794 }
@@ -846,8 +833,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
846833 trait_def_id,
847834 & [ ] ,
848835 trait_segment,
849- trait_segment. args ( ) ,
850- trait_segment. infer_args ,
851836 Some ( self_ty) ,
852837 constness,
853838 )
@@ -3074,8 +3059,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
30743059 def_id,
30753060 & [ ] ,
30763061 & hir:: PathSegment :: invalid ( ) ,
3077- & GenericArgs :: none ( ) ,
3078- true ,
30793062 None ,
30803063 ty:: BoundConstness :: NotConst ,
30813064 ) ;
0 commit comments