mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user