mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Rollup merge of #67845 - jumbatm:also-unconst-hack-abs, r=oli-obk
Also remove const-hack for abs Closes #67842. r? @oli-obk
This commit is contained in:
commit
59f8ba3a4e
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user