From 204623a45ac65dcf965499b067796e9ec46657eb Mon Sep 17 00:00:00 2001 From: Jacob Pratt Date: Mon, 28 Feb 2022 15:02:20 -0500 Subject: [PATCH] Stabilize `int_roundings` --- compiler/rustc_codegen_ssa/src/lib.rs | 1 - library/core/src/num/int_macros.rs | 16 ++++++++-------- library/core/src/num/uint_macros.rs | 16 ++++++++-------- library/core/tests/lib.rs | 1 - 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/lib.rs b/compiler/rustc_codegen_ssa/src/lib.rs index 0faf51b062b4c..9152328a3c331 100644 --- a/compiler/rustc_codegen_ssa/src/lib.rs +++ b/compiler/rustc_codegen_ssa/src/lib.rs @@ -5,7 +5,6 @@ #![feature(once_cell)] #![feature(associated_type_bounds)] #![feature(strict_provenance)] -#![feature(int_roundings)] #![feature(if_let_guard)] #![recursion_limit = "256"] #![allow(rustc::potential_query_instability)] diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 92b12ed33528d..f5b5077124c64 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -2033,7 +2033,6 @@ macro_rules! int_impl { /// Basic usage: /// /// ``` - /// #![feature(int_roundings)] #[doc = concat!("let a: ", stringify!($SelfT)," = 8;")] /// let b = 3; /// @@ -2042,7 +2041,8 @@ macro_rules! int_impl { /// assert_eq!((-a).div_floor(b), -3); /// assert_eq!((-a).div_floor(-b), 2); /// ``` - #[unstable(feature = "int_roundings", issue = "88581")] + #[stable(feature = "int_roundings", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "int_roundings", since = "CURRENT_RUSTC_VERSION")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -2073,7 +2073,6 @@ macro_rules! int_impl { /// Basic usage: /// /// ``` - /// #![feature(int_roundings)] #[doc = concat!("let a: ", stringify!($SelfT)," = 8;")] /// let b = 3; /// @@ -2082,7 +2081,8 @@ macro_rules! int_impl { /// assert_eq!((-a).div_ceil(b), -2); /// assert_eq!((-a).div_ceil(-b), 3); /// ``` - #[unstable(feature = "int_roundings", issue = "88581")] + #[stable(feature = "int_roundings", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "int_roundings", since = "CURRENT_RUSTC_VERSION")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -2116,7 +2116,6 @@ macro_rules! int_impl { /// Basic usage: /// /// ``` - /// #![feature(int_roundings)] #[doc = concat!("assert_eq!(16_", stringify!($SelfT), ".next_multiple_of(8), 16);")] #[doc = concat!("assert_eq!(23_", stringify!($SelfT), ".next_multiple_of(8), 24);")] #[doc = concat!("assert_eq!(16_", stringify!($SelfT), ".next_multiple_of(-8), 16);")] @@ -2126,7 +2125,8 @@ macro_rules! int_impl { #[doc = concat!("assert_eq!((-16_", stringify!($SelfT), ").next_multiple_of(-8), -16);")] #[doc = concat!("assert_eq!((-23_", stringify!($SelfT), ").next_multiple_of(-8), -24);")] /// ``` - #[unstable(feature = "int_roundings", issue = "88581")] + #[stable(feature = "int_roundings", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "int_roundings", since = "CURRENT_RUSTC_VERSION")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -2162,7 +2162,6 @@ macro_rules! int_impl { /// Basic usage: /// /// ``` - /// #![feature(int_roundings)] #[doc = concat!("assert_eq!(16_", stringify!($SelfT), ".checked_next_multiple_of(8), Some(16));")] #[doc = concat!("assert_eq!(23_", stringify!($SelfT), ".checked_next_multiple_of(8), Some(24));")] #[doc = concat!("assert_eq!(16_", stringify!($SelfT), ".checked_next_multiple_of(-8), Some(16));")] @@ -2174,7 +2173,8 @@ macro_rules! int_impl { #[doc = concat!("assert_eq!(1_", stringify!($SelfT), ".checked_next_multiple_of(0), None);")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.checked_next_multiple_of(2), None);")] /// ``` - #[unstable(feature = "int_roundings", issue = "88581")] + #[stable(feature = "int_roundings", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "int_roundings", since = "CURRENT_RUSTC_VERSION")] #[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 aa3e8b9974ecb..f94c65c153359 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -2033,10 +2033,10 @@ macro_rules! uint_impl { /// Basic usage: /// /// ``` - /// #![feature(int_roundings)] #[doc = concat!("assert_eq!(7_", stringify!($SelfT), ".div_floor(4), 1);")] /// ``` - #[unstable(feature = "int_roundings", issue = "88581")] + #[stable(feature = "int_roundings", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "int_roundings", since = "CURRENT_RUSTC_VERSION")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline(always)] @@ -2060,10 +2060,10 @@ macro_rules! uint_impl { /// Basic usage: /// /// ``` - /// #![feature(int_roundings)] #[doc = concat!("assert_eq!(7_", stringify!($SelfT), ".div_ceil(4), 2);")] /// ``` - #[unstable(feature = "int_roundings", issue = "88581")] + #[stable(feature = "int_roundings", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "int_roundings", since = "CURRENT_RUSTC_VERSION")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -2095,11 +2095,11 @@ macro_rules! uint_impl { /// Basic usage: /// /// ``` - /// #![feature(int_roundings)] #[doc = concat!("assert_eq!(16_", stringify!($SelfT), ".next_multiple_of(8), 16);")] #[doc = concat!("assert_eq!(23_", stringify!($SelfT), ".next_multiple_of(8), 24);")] /// ``` - #[unstable(feature = "int_roundings", issue = "88581")] + #[stable(feature = "int_roundings", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "int_roundings", since = "CURRENT_RUSTC_VERSION")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -2120,13 +2120,13 @@ macro_rules! uint_impl { /// Basic usage: /// /// ``` - /// #![feature(int_roundings)] #[doc = concat!("assert_eq!(16_", stringify!($SelfT), ".checked_next_multiple_of(8), Some(16));")] #[doc = concat!("assert_eq!(23_", stringify!($SelfT), ".checked_next_multiple_of(8), Some(24));")] #[doc = concat!("assert_eq!(1_", stringify!($SelfT), ".checked_next_multiple_of(0), None);")] #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.checked_next_multiple_of(2), None);")] /// ``` - #[unstable(feature = "int_roundings", issue = "88581")] + #[stable(feature = "int_roundings", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "int_roundings", since = "CURRENT_RUSTC_VERSION")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs index c315f3a797512..d477388553143 100644 --- a/library/core/tests/lib.rs +++ b/library/core/tests/lib.rs @@ -85,7 +85,6 @@ #![feature(const_option_ext)] #![feature(const_result)] #![feature(integer_atomics)] -#![feature(int_roundings)] #![feature(slice_group_by)] #![feature(split_array)] #![feature(strict_provenance)]