Skip to content

Commit b6d7ff3

Browse files
committed
Auto merge of #148944 - theemathas:rm_inherit_overflow, r=joboet
Remove `rustc_inherit_overflow_checks` from `position()` in slice iterators This method implementation can never cause an overflow, since `i` can never go over the slice's length.
2 parents 42f4793 + 8d075ae commit b6d7ff3

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

library/core/src/slice/iter/macros.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ macro_rules! iterator {
350350
// because this simple implementation generates less LLVM IR and is
351351
// faster to compile. Also, the `assume` avoids a bounds check.
352352
#[inline]
353-
#[rustc_inherit_overflow_checks]
354353
fn position<P>(&mut self, mut predicate: P) -> Option<usize> where
355354
Self: Sized,
356355
P: FnMut(Self::Item) -> bool,

0 commit comments

Comments
 (0)