diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index f590c6bc7c2..38989004f91 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -1091,8 +1091,9 @@ $EndFeature, " ```"), #[unstable(feature = "saturating_neg", issue = "59983")] + #[rustc_const_unstable(feature = "const_int_saturating", issue = "53718")] #[inline] - pub fn saturating_neg(self) -> Self { + pub const fn saturating_neg(self) -> Self { intrinsics::saturating_sub(0, self) } } @@ -1117,8 +1118,9 @@ $EndFeature, " ```"), #[unstable(feature = "saturating_neg", issue = "59983")] + #[rustc_const_unstable(feature = "const_int_saturating", issue = "53718")] #[inline] - pub fn saturating_abs(self) -> Self { + pub const fn saturating_abs(self) -> Self { if self.is_negative() { self.saturating_neg() } else {