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 e7d69e8 + 525cd2d commit 21d9a09
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 21d9a09

Please sign in to comment.