Skip to content

Commit

Permalink
Rollup merge of rust-lang#67845 - jumbatm:also-unconst-hack-abs, r=ol…
Browse files Browse the repository at this point in the history
…i-obk

Also remove const-hack for abs

Closes rust-lang#67842.

r? @oli-obk
  • Loading branch information
Dylan-DPC authored Jan 5, 2020
2 parents 3548d98 + 525cd2d commit 59f8ba3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2001,6 +2001,9 @@ $EndFeature, "
#[inline]
#[rustc_inherit_overflow_checks]
pub const fn abs(self) -> Self {
// Note that the #[inline] above means that the overflow
// semantics of the subtraction depend on the crate we're being
// inlined into.
if self.is_negative() {
-self
} else {
Expand Down

0 comments on commit 59f8ba3

Please sign in to comment.