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.
This commit is contained in:
bors 2025-11-14 18:47:43 +00:00
commit b6d7ff3aa7

View file

@ -350,7 +350,6 @@ macro_rules! iterator {
// because this simple implementation generates less LLVM IR and is
// faster to compile. Also, the `assume` avoids a bounds check.
#[inline]
#[rustc_inherit_overflow_checks]
fn position<P>(&mut self, mut predicate: P) -> Option<usize> where
Self: Sized,
P: FnMut(Self::Item) -> bool,