diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 2dd48ef18369b..ff08122388cf3 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -126,8 +126,6 @@ #![feature(str_split_inclusive_remainder)] #![feature(str_split_remainder)] #![feature(ub_checks)] -#![feature(unchecked_neg)] -#![feature(unchecked_shifts)] #![feature(unsafe_pinned)] #![feature(utf16_extra)] #![feature(variant_count)] diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 93fdf2823aeb7..9606572fce7e9 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -1259,11 +1259,8 @@ macro_rules! int_impl { /// i.e. when [`checked_neg`] would return `None`. /// #[doc = concat!("[`checked_neg`]: ", stringify!($SelfT), "::checked_neg")] - #[unstable( - feature = "unchecked_neg", - reason = "niche optimization path", - issue = "85122", - )] + #[stable(feature = "unchecked_neg", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "unchecked_neg", since = "CURRENT_RUSTC_VERSION")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline(always)] @@ -1379,11 +1376,8 @@ macro_rules! int_impl { /// i.e. when [`checked_shl`] would return `None`. /// #[doc = concat!("[`checked_shl`]: ", stringify!($SelfT), "::checked_shl")] - #[unstable( - feature = "unchecked_shifts", - reason = "niche optimization path", - issue = "85122", - )] + #[stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline(always)] @@ -1554,11 +1548,8 @@ macro_rules! int_impl { /// i.e. when [`checked_shr`] would return `None`. /// #[doc = concat!("[`checked_shr`]: ", stringify!($SelfT), "::checked_shr")] - #[unstable( - feature = "unchecked_shifts", - reason = "niche optimization path", - issue = "85122", - )] + #[stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline(always)] diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index 1d108cb0cf4a9..68a8ba9ee6b13 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -1781,11 +1781,8 @@ macro_rules! uint_impl { /// i.e. when [`checked_shl`] would return `None`. /// #[doc = concat!("[`checked_shl`]: ", stringify!($SelfT), "::checked_shl")] - #[unstable( - feature = "unchecked_shifts", - reason = "niche optimization path", - issue = "85122", - )] + #[stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline(always)] @@ -1953,11 +1950,8 @@ macro_rules! uint_impl { /// i.e. when [`checked_shr`] would return `None`. /// #[doc = concat!("[`checked_shr`]: ", stringify!($SelfT), "::checked_shr")] - #[unstable( - feature = "unchecked_shifts", - reason = "niche optimization path", - issue = "85122", - )] + #[stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")] + #[rustc_const_stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline(always)] diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_shl.rs b/src/tools/miri/tests/fail/intrinsics/unchecked_shl.rs index abb345938fa0e..e22d36c024d7c 100644 --- a/src/tools/miri/tests/fail/intrinsics/unchecked_shl.rs +++ b/src/tools/miri/tests/fail/intrinsics/unchecked_shl.rs @@ -1,5 +1,3 @@ -#![feature(unchecked_shifts)] - fn main() { unsafe { let _n = 1i8.unchecked_shl(8); diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_shr.rs b/src/tools/miri/tests/fail/intrinsics/unchecked_shr.rs index cdc10185e4707..59402be4992b5 100644 --- a/src/tools/miri/tests/fail/intrinsics/unchecked_shr.rs +++ b/src/tools/miri/tests/fail/intrinsics/unchecked_shr.rs @@ -1,5 +1,3 @@ -#![feature(unchecked_shifts)] - fn main() { unsafe { let _n = 1i64.unchecked_shr(64); diff --git a/src/tools/rust-analyzer/crates/ide-db/src/generated/lints.rs b/src/tools/rust-analyzer/crates/ide-db/src/generated/lints.rs index 7f4dad873cd6f..dedc12aa653fd 100644 --- a/src/tools/rust-analyzer/crates/ide-db/src/generated/lints.rs +++ b/src/tools/rust-analyzer/crates/ide-db/src/generated/lints.rs @@ -11840,34 +11840,6 @@ extern "rust-call" fn add_args(args: (u32, u32)) -> u32 { fn main() {} ``` -"##, - default_severity: Severity::Allow, - warn_since: None, - deny_since: None, - }, - Lint { - label: "unchecked_neg", - description: r##"# `unchecked_neg` - -The tracking issue for this feature is: [#85122] - -[#85122]: https://github.com/rust-lang/rust/issues/85122 - ------------------------- -"##, - default_severity: Severity::Allow, - warn_since: None, - deny_since: None, - }, - Lint { - label: "unchecked_shifts", - description: r##"# `unchecked_shifts` - -The tracking issue for this feature is: [#85122] - -[#85122]: https://github.com/rust-lang/rust/issues/85122 - ------------------------- "##, default_severity: Severity::Allow, warn_since: None, diff --git a/tests/codegen-llvm/checked_math.rs b/tests/codegen-llvm/checked_math.rs index 66667c6948818..f24d9f24dcb23 100644 --- a/tests/codegen-llvm/checked_math.rs +++ b/tests/codegen-llvm/checked_math.rs @@ -1,7 +1,6 @@ //@ compile-flags: -Copt-level=3 -Z merge-functions=disabled #![crate_type = "lib"] -#![feature(unchecked_shifts)] // Because the result of something like `u32::checked_sub` can only be used if it // didn't overflow, make sure that LLVM actually knows that in optimized builds. diff --git a/tests/codegen-llvm/unchecked_shifts.rs b/tests/codegen-llvm/unchecked_shifts.rs index 3f533718a2d0d..2e17a827f62f5 100644 --- a/tests/codegen-llvm/unchecked_shifts.rs +++ b/tests/codegen-llvm/unchecked_shifts.rs @@ -4,7 +4,6 @@ // optimizations so it doesn't need to worry about them adding more flags. #![crate_type = "lib"] -#![feature(unchecked_shifts)] #![feature(core_intrinsics)] // CHECK-LABEL: @unchecked_shl_unsigned_same diff --git a/tests/mir-opt/inline/unchecked_shifts.rs b/tests/mir-opt/inline/unchecked_shifts.rs index 122f099da4b7d..a20b13dc1149d 100644 --- a/tests/mir-opt/inline/unchecked_shifts.rs +++ b/tests/mir-opt/inline/unchecked_shifts.rs @@ -1,6 +1,5 @@ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![crate_type = "lib"] -#![feature(unchecked_shifts)] //@ compile-flags: -Zmir-opt-level=2 -Zinline-mir diff --git a/tests/ui/precondition-checks/unchecked_shl.rs b/tests/ui/precondition-checks/unchecked_shl.rs index 57c617e08455b..20eaeb2dbaeac 100644 --- a/tests/ui/precondition-checks/unchecked_shl.rs +++ b/tests/ui/precondition-checks/unchecked_shl.rs @@ -2,8 +2,6 @@ //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes //@ error-pattern: unsafe precondition(s) violated: u8::unchecked_shl cannot overflow -#![feature(unchecked_shifts)] - fn main() { unsafe { 0u8.unchecked_shl(u8::BITS); diff --git a/tests/ui/precondition-checks/unchecked_shr.rs b/tests/ui/precondition-checks/unchecked_shr.rs index 18502d2b64593..c66fd3729a71f 100644 --- a/tests/ui/precondition-checks/unchecked_shr.rs +++ b/tests/ui/precondition-checks/unchecked_shr.rs @@ -2,8 +2,6 @@ //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes //@ error-pattern: unsafe precondition(s) violated: u8::unchecked_shr cannot overflow -#![feature(unchecked_shifts)] - fn main() { unsafe { 0u8.unchecked_shr(u8::BITS);