Skip to content

Commit 84f5bcc

Browse files
authored
Rollup merge of #69430 - matthiaskrgr:noloop, r=varkor
librustc_typeck: remove loop that never actually loops
2 parents 350491d + b6f0567 commit 84f5bcc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustc_typeck/astconv.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -2439,10 +2439,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
24392439
break;
24402440
}
24412441
}
2442-
for binding in segment.generic_args().bindings {
2442+
2443+
// Only emit the first error to avoid overloading the user with error messages.
2444+
if let [binding, ..] = segment.generic_args().bindings {
24432445
has_err = true;
24442446
Self::prohibit_assoc_ty_binding(self.tcx(), binding.span);
2445-
break;
24462447
}
24472448
}
24482449
has_err

0 commit comments

Comments
 (0)