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
-1
View File
@@ -350,7 +350,6 @@ fn find_map<B, F>(&mut self, mut f: F) -> Option<B>
// 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,