From 0cd49018d1e2d0e7b229aa9283b9254c58cd930b Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Tue, 28 Mar 2023 00:01:16 +0000 Subject: [PATCH] Revert "Make the `Step` implementations const." This reverts commit 7bc67ef6e02d69023c6fb04c2258beab54ac22b8. --- library/core/src/iter/range.rs | 20 ++++++-------------- library/core/src/iter/traits/marker.rs | 3 +-- library/core/src/lib.rs | 1 - 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/library/core/src/iter/range.rs b/library/core/src/iter/range.rs index 2273bead416..37db074293d 100644 --- a/library/core/src/iter/range.rs +++ b/library/core/src/iter/range.rs @@ -21,8 +21,7 @@ unsafe_impl_trusted_step![char i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usi /// The *successor* operation moves towards values that compare greater. /// The *predecessor* operation moves towards values that compare lesser. #[unstable(feature = "step_trait", reason = "recently redesigned", issue = "42168")] -#[const_trait] -pub trait Step: ~const Clone + ~const PartialOrd + Sized { +pub trait Step: Clone + PartialOrd + Sized { /// Returns the number of *successor* steps required to get from `start` to `end`. /// /// Returns `None` if the number of steps would overflow `usize` @@ -236,8 +235,7 @@ macro_rules! step_integer_impls { $( #[allow(unreachable_patterns)] #[unstable(feature = "step_trait", reason = "recently redesigned", issue = "42168")] - #[rustc_const_unstable(feature = "const_iter", issue = "92476")] - impl const Step for $u_narrower { + impl Step for $u_narrower { step_identical_methods!(); #[inline] @@ -269,8 +267,7 @@ macro_rules! step_integer_impls { #[allow(unreachable_patterns)] #[unstable(feature = "step_trait", reason = "recently redesigned", issue = "42168")] - #[rustc_const_unstable(feature = "const_iter", issue = "92476")] - impl const Step for $i_narrower { + impl Step for $i_narrower { step_identical_methods!(); #[inline] @@ -334,8 +331,7 @@ macro_rules! step_integer_impls { $( #[allow(unreachable_patterns)] #[unstable(feature = "step_trait", reason = "recently redesigned", issue = "42168")] - #[rustc_const_unstable(feature = "const_iter", issue = "92476")] - impl const Step for $u_wider { + impl Step for $u_wider { step_identical_methods!(); #[inline] @@ -360,8 +356,7 @@ macro_rules! step_integer_impls { #[allow(unreachable_patterns)] #[unstable(feature = "step_trait", reason = "recently redesigned", issue = "42168")] - #[rustc_const_unstable(feature = "const_iter", issue = "92476")] - impl const Step for $i_wider { + impl Step for $i_wider { step_identical_methods!(); #[inline] @@ -411,8 +406,7 @@ step_integer_impls! { } #[unstable(feature = "step_trait", reason = "recently redesigned", issue = "42168")] -#[rustc_const_unstable(feature = "const_iter", issue = "92476")] -impl const Step for char { +impl Step for char { #[inline] fn steps_between(&start: &char, &end: &char) -> Option { let start = start as u32; @@ -430,7 +424,6 @@ impl const Step for char { } #[inline] - #[rustc_allow_const_fn_unstable(const_try)] fn forward_checked(start: char, count: usize) -> Option { let start = start as u32; let mut res = Step::forward_checked(start, count)?; @@ -447,7 +440,6 @@ impl const Step for char { } #[inline] - #[rustc_allow_const_fn_unstable(const_try)] fn backward_checked(start: char, count: usize) -> Option { let start = start as u32; let mut res = Step::backward_checked(start, count)?; diff --git a/library/core/src/iter/traits/marker.rs b/library/core/src/iter/traits/marker.rs index c8f60defff7..af02848233d 100644 --- a/library/core/src/iter/traits/marker.rs +++ b/library/core/src/iter/traits/marker.rs @@ -86,5 +86,4 @@ pub unsafe trait InPlaceIterable: Iterator {} /// for details. Consumers are free to rely on the invariants in unsafe code. #[unstable(feature = "trusted_step", issue = "85731")] #[rustc_specialization_trait] -#[const_trait] -pub unsafe trait TrustedStep: ~const Step {} +pub unsafe trait TrustedStep: Step {} diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index d195e24ef46..4fd5a4bfc65 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -126,7 +126,6 @@ #![feature(const_intrinsic_forget)] #![feature(const_ipv4)] #![feature(const_ipv6)] -#![feature(const_iter)] #![feature(const_likely)] #![feature(const_maybe_uninit_uninit_array)] #![feature(const_maybe_uninit_as_mut_ptr)]