Skip to content

Commit 395ab82

Browse files
committed
Stabilize unchecked_neg and unchecked_shifts
1 parent ddc961f commit 395ab82

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
@@ -1259,11 +1259,8 @@ macro_rules! int_impl {
12591259
/// i.e. when [`checked_neg`] would return `None`.
12601260
///
12611261
#[doc = concat!("[`checked_neg`]: ", stringify!($SelfT), "::checked_neg")]
1262-
#[unstable(
1263-
feature = "unchecked_neg",
1264-
reason = "niche optimization path",
1265-
issue = "85122",
1266-
)]
1262+
#[stable(feature = "unchecked_neg", since = "CURRENT_RUSTC_VERSION")]
1263+
#[rustc_const_stable(feature = "unchecked_neg", since = "CURRENT_RUSTC_VERSION")]
12671264
#[must_use = "this returns the result of the operation, \
12681265
without modifying the original"]
12691266
#[inline(always)]
@@ -1379,11 +1376,8 @@ macro_rules! int_impl {
13791376
/// i.e. when [`checked_shl`] would return `None`.
13801377
///
13811378
#[doc = concat!("[`checked_shl`]: ", stringify!($SelfT), "::checked_shl")]
1382-
#[unstable(
1383-
feature = "unchecked_shifts",
1384-
reason = "niche optimization path",
1385-
issue = "85122",
1386-
)]
1379+
#[stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
1380+
#[rustc_const_stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
13871381
#[must_use = "this returns the result of the operation, \
13881382
without modifying the original"]
13891383
#[inline(always)]
@@ -1554,11 +1548,8 @@ macro_rules! int_impl {
15541548
/// i.e. when [`checked_shr`] would return `None`.
15551549
///
15561550
#[doc = concat!("[`checked_shr`]: ", stringify!($SelfT), "::checked_shr")]
1557-
#[unstable(
1558-
feature = "unchecked_shifts",
1559-
reason = "niche optimization path",
1560-
issue = "85122",
1561-
)]
1551+
#[stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
1552+
#[rustc_const_stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
15621553
#[must_use = "this returns the result of the operation, \
15631554
without modifying the original"]
15641555
#[inline(always)]

core/src/num/uint_macros.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,11 +1781,8 @@ macro_rules! uint_impl {
17811781
/// i.e. when [`checked_shl`] would return `None`.
17821782
///
17831783
#[doc = concat!("[`checked_shl`]: ", stringify!($SelfT), "::checked_shl")]
1784-
#[unstable(
1785-
feature = "unchecked_shifts",
1786-
reason = "niche optimization path",
1787-
issue = "85122",
1788-
)]
1784+
#[stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
1785+
#[rustc_const_stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
17891786
#[must_use = "this returns the result of the operation, \
17901787
without modifying the original"]
17911788
#[inline(always)]
@@ -1953,11 +1950,8 @@ macro_rules! uint_impl {
19531950
/// i.e. when [`checked_shr`] would return `None`.
19541951
///
19551952
#[doc = concat!("[`checked_shr`]: ", stringify!($SelfT), "::checked_shr")]
1956-
#[unstable(
1957-
feature = "unchecked_shifts",
1958-
reason = "niche optimization path",
1959-
issue = "85122",
1960-
)]
1953+
#[stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
1954+
#[rustc_const_stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
19611955
#[must_use = "this returns the result of the operation, \
19621956
without modifying the original"]
19631957
#[inline(always)]

0 commit comments

Comments
 (0)