Skip to content

Commit fd33955

Browse files
committed
Add inheriting overflow cheks back
1 parent bd65462 commit fd33955

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/core/src/iter/traits/iterator.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3098,6 +3098,7 @@ pub trait Iterator {
30983098
mut predicate: impl FnMut(T) -> bool + 'a,
30993099
acc: &'a mut usize,
31003100
) -> impl FnMut((), T) -> ControlFlow<usize, ()> + 'a {
3101+
#[rustc_inherit_overflow_checks]
31013102
move |_, x| {
31023103
if predicate(x) {
31033104
ControlFlow::Break(*acc)
@@ -3107,7 +3108,7 @@ pub trait Iterator {
31073108
}
31083109
}
31093110
}
3110-
3111+
31113112
let mut acc = 0;
31123113
self.try_fold((), check(predicate, &mut acc)).break_value()
31133114
}

0 commit comments

Comments
 (0)