We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd65462 commit fd33955Copy full SHA for fd33955
library/core/src/iter/traits/iterator.rs
@@ -3098,6 +3098,7 @@ pub trait Iterator {
3098
mut predicate: impl FnMut(T) -> bool + 'a,
3099
acc: &'a mut usize,
3100
) -> impl FnMut((), T) -> ControlFlow<usize, ()> + 'a {
3101
+ #[rustc_inherit_overflow_checks]
3102
move |_, x| {
3103
if predicate(x) {
3104
ControlFlow::Break(*acc)
@@ -3107,7 +3108,7 @@ pub trait Iterator {
3107
3108
}
3109
3110
-
3111
+
3112
let mut acc = 0;
3113
self.try_fold((), check(predicate, &mut acc)).break_value()
3114
0 commit comments