Skip to content

Commit 01b2b35

Browse files
authored
Rollup merge of rust-lang#69430 - matthiaskrgr:noloop, r=varkor
librustc_typeck: remove loop that never actually loops
2 parents f7f57eb + b6f0567 commit 01b2b35

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
@@ -2358,10 +2358,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
23582358
break;
23592359
}
23602360
}
2361-
for binding in segment.generic_args().bindings {
2361+
2362+
// Only emit the first error to avoid overloading the user with error messages.
2363+
if let [binding, ..] = segment.generic_args().bindings {
23622364
has_err = true;
23632365
Self::prohibit_assoc_ty_binding(self.tcx(), binding.span);
2364-
break;
23652366
}
23662367
}
23672368
has_err

0 commit comments

Comments
 (0)