Skip to content

Commit 8d075ae

Browse files
committed
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.
1 parent 34a8c73 commit 8d075ae

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)