Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
21 changes: 6 additions & 15 deletions library/core/src/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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)]
Expand Down Expand Up @@ -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)]
Expand Down
14 changes: 4 additions & 10 deletions library/core/src/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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)]
Expand Down
2 changes: 0 additions & 2 deletions src/tools/miri/tests/fail/intrinsics/unchecked_shl.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(unchecked_shifts)]

fn main() {
unsafe {
let _n = 1i8.unchecked_shl(8);
Expand Down
2 changes: 0 additions & 2 deletions src/tools/miri/tests/fail/intrinsics/unchecked_shr.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(unchecked_shifts)]

fn main() {
unsafe {
let _n = 1i64.unchecked_shr(64);
Expand Down
28 changes: 0 additions & 28 deletions src/tools/rust-analyzer/crates/ide-db/src/generated/lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tests/codegen-llvm/checked_math.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
1 change: 0 additions & 1 deletion tests/codegen-llvm/unchecked_shifts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion tests/mir-opt/inline/unchecked_shifts.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#![crate_type = "lib"]
#![feature(unchecked_shifts)]

//@ compile-flags: -Zmir-opt-level=2 -Zinline-mir

Expand Down
2 changes: 0 additions & 2 deletions tests/ui/precondition-checks/unchecked_shl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/precondition-checks/unchecked_shr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading