@@ -276,9 +276,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
276
276
item_segment. infer_args ,
277
277
None ,
278
278
) ;
279
- let assoc_bindings = self . create_assoc_bindings_for_generic_args ( item_segment. args ( ) ) ;
280
-
281
- if let Some ( b) = assoc_bindings. first ( ) {
279
+ if let Some ( b) = item_segment. args ( ) . bindings . first ( ) {
282
280
Self :: prohibit_assoc_ty_binding ( self . tcx ( ) , b. span ) ;
283
281
}
284
282
@@ -605,8 +603,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
605
603
None ,
606
604
) ;
607
605
608
- let assoc_bindings = self . create_assoc_bindings_for_generic_args ( item_segment. args ( ) ) ;
609
- if let Some ( b) = assoc_bindings. first ( ) {
606
+ if let Some ( b) = item_segment. args ( ) . bindings . first ( ) {
610
607
Self :: prohibit_assoc_ty_binding ( self . tcx ( ) , b. span ) ;
611
608
}
612
609
@@ -794,8 +791,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
794
791
trait_segment,
795
792
is_impl,
796
793
) ;
797
- let assoc_bindings = self . create_assoc_bindings_for_generic_args ( trait_segment. args ( ) ) ;
798
- if let Some ( b) = assoc_bindings. first ( ) {
794
+ if let Some ( b) = trait_segment. args ( ) . bindings . first ( ) {
799
795
Self :: prohibit_assoc_ty_binding ( self . tcx ( ) , b. span ) ;
800
796
}
801
797
ty:: TraitRef :: new ( trait_def_id, substs)
@@ -2207,8 +2203,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2207
2203
2208
2204
for segment in segments {
2209
2205
// Only emit the first error to avoid overloading the user with error messages.
2210
- if let [ binding , .. ] = segment. args ( ) . bindings {
2211
- Self :: prohibit_assoc_ty_binding ( self . tcx ( ) , binding . span ) ;
2206
+ if let Some ( b ) = segment. args ( ) . bindings . first ( ) {
2207
+ Self :: prohibit_assoc_ty_binding ( self . tcx ( ) , b . span ) ;
2212
2208
return true ;
2213
2209
}
2214
2210
}
0 commit comments