Skip to content

Commit

Permalink
Allow libcore to be built with MIR inlining
Browse files Browse the repository at this point in the history
Inlining caused new lints to get emitted, so we silence those lints now that we actually can.
  • Loading branch information
oli-obk committed Jan 23, 2021
1 parent 0491e74 commit f238148
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/core/src/iter/range.rs
Expand Up @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit f238148

Please sign in to comment.