Skip to content

Commit 206df2d

Browse files
authored
Rollup merge of rust-lang#149087 - nxsaken:unchecked_neg_shifts_stabilize, r=Amanieu
Stabilize `unchecked_neg` and `unchecked_shifts` Features: `unchecked_neg`, `unchecked_shifts` Tracking issue: rust-lang#85122 r? `@Amanieu`
2 parents 57220a5 + 395ab82 commit 206df2d

3 files changed

Lines changed: 10 additions & 27 deletions

File tree

core/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@
126126
#![feature(str_split_inclusive_remainder)]
127127
#![feature(str_split_remainder)]
128128
#![feature(ub_checks)]
129-
#![feature(unchecked_neg)]
130-
#![feature(unchecked_shifts)]
131129
#![feature(unsafe_pinned)]
132130
#![feature(utf16_extra)]
133131
#![feature(variant_count)]

core/src/num/int_macros.rs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,11 +1275,8 @@ macro_rules! int_impl {
12751275
/// i.e. when [`checked_neg`] would return `None`.
12761276
///
12771277
#[doc = concat!("[`checked_neg`]: ", stringify!($SelfT), "::checked_neg")]
1278-
#[unstable(
1279-
feature = "unchecked_neg",
1280-
reason = "niche optimization path",
1281-
issue = "85122",
1282-
)]
1278+
#[stable(feature = "unchecked_neg", since = "CURRENT_RUSTC_VERSION")]
1279+
#[rustc_const_stable(feature = "unchecked_neg", since = "CURRENT_RUSTC_VERSION")]
12831280
#[must_use = "this returns the result of the operation, \
12841281
without modifying the original"]
12851282
#[inline(always)]
@@ -1395,11 +1392,8 @@ macro_rules! int_impl {
13951392
/// i.e. when [`checked_shl`] would return `None`.
13961393
///
13971394
#[doc = concat!("[`checked_shl`]: ", stringify!($SelfT), "::checked_shl")]
1398-
#[unstable(
1399-
feature = "unchecked_shifts",
1400-
reason = "niche optimization path",
1401-
issue = "85122",
1402-
)]
1395+
#[stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
1396+
#[rustc_const_stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
14031397
#[must_use = "this returns the result of the operation, \
14041398
without modifying the original"]
14051399
#[inline(always)]
@@ -1570,11 +1564,8 @@ macro_rules! int_impl {
15701564
/// i.e. when [`checked_shr`] would return `None`.
15711565
///
15721566
#[doc = concat!("[`checked_shr`]: ", stringify!($SelfT), "::checked_shr")]
1573-
#[unstable(
1574-
feature = "unchecked_shifts",
1575-
reason = "niche optimization path",
1576-
issue = "85122",
1577-
)]
1567+
#[stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
1568+
#[rustc_const_stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
15781569
#[must_use = "this returns the result of the operation, \
15791570
without modifying the original"]
15801571
#[inline(always)]

core/src/num/uint_macros.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,11 +1851,8 @@ macro_rules! uint_impl {
18511851
/// i.e. when [`checked_shl`] would return `None`.
18521852
///
18531853
#[doc = concat!("[`checked_shl`]: ", stringify!($SelfT), "::checked_shl")]
1854-
#[unstable(
1855-
feature = "unchecked_shifts",
1856-
reason = "niche optimization path",
1857-
issue = "85122",
1858-
)]
1854+
#[stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
1855+
#[rustc_const_stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
18591856
#[must_use = "this returns the result of the operation, \
18601857
without modifying the original"]
18611858
#[inline(always)]
@@ -2023,11 +2020,8 @@ macro_rules! uint_impl {
20232020
/// i.e. when [`checked_shr`] would return `None`.
20242021
///
20252022
#[doc = concat!("[`checked_shr`]: ", stringify!($SelfT), "::checked_shr")]
2026-
#[unstable(
2027-
feature = "unchecked_shifts",
2028-
reason = "niche optimization path",
2029-
issue = "85122",
2030-
)]
2023+
#[stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
2024+
#[rustc_const_stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
20312025
#[must_use = "this returns the result of the operation, \
20322026
without modifying the original"]
20332027
#[inline(always)]

0 commit comments

Comments
 (0)