@@ -751,33 +751,9 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
751
751
// FIXME(effects): Move all host param things in HIR ty lowering to AST lowering.
752
752
constness : ty:: BoundConstness ,
753
753
) -> ty:: TraitRef < ' tcx > {
754
- let ( generic_args, _) = self . lower_generic_args_of_trait_ref (
755
- span,
756
- trait_def_id,
757
- self_ty,
758
- trait_segment,
759
- is_impl,
760
- constness,
761
- ) ;
762
- if let Some ( b) = trait_segment. args ( ) . bindings . first ( ) {
763
- prohibit_assoc_item_binding ( self . tcx ( ) , b. span , Some ( ( trait_segment, span) ) ) ;
764
- }
765
- ty:: TraitRef :: new ( self . tcx ( ) , trait_def_id, generic_args)
766
- }
767
-
768
- #[ instrument( level = "debug" , skip( self , span) ) ]
769
- fn lower_generic_args_of_trait_ref < ' a > (
770
- & self ,
771
- span : Span ,
772
- trait_def_id : DefId ,
773
- self_ty : Ty < ' tcx > ,
774
- trait_segment : & ' a hir:: PathSegment < ' tcx > ,
775
- is_impl : bool ,
776
- constness : ty:: BoundConstness ,
777
- ) -> ( GenericArgsRef < ' tcx > , GenericArgCountResult ) {
778
754
self . complain_about_internal_fn_trait ( span, trait_def_id, trait_segment, is_impl) ;
779
755
780
- self . lower_generic_args_of_path (
756
+ let ( generic_args , _ ) = self . lower_generic_args_of_path (
781
757
span,
782
758
trait_def_id,
783
759
& [ ] ,
@@ -786,7 +762,11 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
786
762
trait_segment. infer_args ,
787
763
Some ( self_ty) ,
788
764
constness,
789
- )
765
+ ) ;
766
+ if let Some ( b) = trait_segment. args ( ) . bindings . first ( ) {
767
+ prohibit_assoc_item_binding ( self . tcx ( ) , b. span , Some ( ( trait_segment, span) ) ) ;
768
+ }
769
+ ty:: TraitRef :: new ( self . tcx ( ) , trait_def_id, generic_args)
790
770
}
791
771
792
772
fn probe_trait_that_defines_assoc_item (
0 commit comments