@@ -276,9 +276,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
276276 item_segment. infer_args ,
277277 None ,
278278 ) ;
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 ( ) {
282280 Self :: prohibit_assoc_ty_binding ( self . tcx ( ) , b. span ) ;
283281 }
284282
@@ -605,8 +603,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
605603 None ,
606604 ) ;
607605
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 ( ) {
610607 Self :: prohibit_assoc_ty_binding ( self . tcx ( ) , b. span ) ;
611608 }
612609
@@ -794,8 +791,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
794791 trait_segment,
795792 is_impl,
796793 ) ;
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 ( ) {
799795 Self :: prohibit_assoc_ty_binding ( self . tcx ( ) , b. span ) ;
800796 }
801797 ty:: TraitRef :: new ( trait_def_id, substs)
@@ -2207,8 +2203,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
22072203
22082204 for segment in segments {
22092205 // 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 ) ;
22122208 return true ;
22132209 }
22142210 }
0 commit comments