From 7d91d42993a3b975401bbf7df2b7ce386145be83 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Mon, 7 Feb 2022 11:55:19 +0100 Subject: [PATCH 1/2] Stabilize int_abs_diff in 1.60.0. --- library/core/src/num/int_macros.rs | 3 +-- library/core/src/num/uint_macros.rs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 79436c8e8ed..ccacc224ed6 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -2419,14 +2419,13 @@ macro_rules! int_impl { /// Basic usage: /// /// ``` - /// #![feature(int_abs_diff)] #[doc = concat!("assert_eq!(100", stringify!($SelfT), ".abs_diff(80), 20", stringify!($UnsignedT), ");")] #[doc = concat!("assert_eq!(100", stringify!($SelfT), ".abs_diff(110), 10", stringify!($UnsignedT), ");")] #[doc = concat!("assert_eq!((-100", stringify!($SelfT), ").abs_diff(80), 180", stringify!($UnsignedT), ");")] #[doc = concat!("assert_eq!((-100", stringify!($SelfT), ").abs_diff(-120), 20", stringify!($UnsignedT), ");")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.abs_diff(", stringify!($SelfT), "::MAX), ", stringify!($UnsignedT), "::MAX);")] /// ``` - #[unstable(feature = "int_abs_diff", issue = "89492")] + #[stable(feature = "int_abs_diff", since = "1.60.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index 0bb65497776..7b6ae025228 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -1634,11 +1634,10 @@ macro_rules! uint_impl { /// Basic usage: /// /// ``` - /// #![feature(int_abs_diff)] #[doc = concat!("assert_eq!(100", stringify!($SelfT), ".abs_diff(80), 20", stringify!($SelfT), ");")] #[doc = concat!("assert_eq!(100", stringify!($SelfT), ".abs_diff(110), 10", stringify!($SelfT), ");")] /// ``` - #[unstable(feature = "int_abs_diff", issue = "89492")] + #[stable(feature = "int_abs_diff", since = "1.60.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] From 687d20afb83710b146d74456f0ab1c094062cf81 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Mon, 7 Feb 2022 12:16:44 +0100 Subject: [PATCH 2/2] Mark int_abs_diff as const stable. --- library/core/src/num/int_macros.rs | 1 + library/core/src/num/uint_macros.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index ccacc224ed6..3b6cf799ee6 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -2426,6 +2426,7 @@ macro_rules! int_impl { #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.abs_diff(", stringify!($SelfT), "::MAX), ", stringify!($UnsignedT), "::MAX);")] /// ``` #[stable(feature = "int_abs_diff", since = "1.60.0")] + #[rustc_const_stable(feature = "int_abs_diff", since = "1.60.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index 7b6ae025228..480e3ef5403 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -1638,6 +1638,7 @@ macro_rules! uint_impl { #[doc = concat!("assert_eq!(100", stringify!($SelfT), ".abs_diff(110), 10", stringify!($SelfT), ");")] /// ``` #[stable(feature = "int_abs_diff", since = "1.60.0")] + #[rustc_const_stable(feature = "int_abs_diff", since = "1.60.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline]