diff --git a/library/core/src/iter/range.rs b/library/core/src/iter/range.rs index 4321b2187e108..9e7055a370c9d 100644 --- a/library/core/src/iter/range.rs +++ b/library/core/src/iter/range.rs @@ -200,6 +200,7 @@ macro_rules! step_identical_methods { } #[inline] + #[allow(arithmetic_overflow)] fn forward(start: Self, n: usize) -> Self { // In debug builds, trigger a panic on overflow. // This should optimize completely out in release builds. @@ -211,6 +212,7 @@ macro_rules! step_identical_methods { } #[inline] + #[allow(arithmetic_overflow)] fn backward(start: Self, n: usize) -> Self { // In debug builds, trigger a panic on overflow. // This should optimize completely out in release builds.