From 8d075ae0aac7fdc90af8058f7df0927011ac637c Mon Sep 17 00:00:00 2001 From: Theemathas Chirananthavat Date: Fri, 14 Nov 2025 20:12:11 +0700 Subject: [PATCH] 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. --- library/core/src/slice/iter/macros.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/library/core/src/slice/iter/macros.rs b/library/core/src/slice/iter/macros.rs index 7c1ed3fe8a24..c46b7c797aab 100644 --- a/library/core/src/slice/iter/macros.rs +++ b/library/core/src/slice/iter/macros.rs @@ -350,7 +350,6 @@ fn find_map(&mut self, mut f: F) -> Option // 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

(&mut self, mut predicate: P) -> Option where Self: Sized, P: FnMut(Self::Item) -> bool,