Skip to content

Commit 0cd4901

Browse files
committed
Revert "Make the Step implementations const."
This reverts commit 7bc67ef.
1 parent 04a5d61 commit 0cd4901

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

library/core/src/iter/range.rs

+6-14
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ unsafe_impl_trusted_step![char i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usi
2121
/// The *successor* operation moves towards values that compare greater.
2222
/// The *predecessor* operation moves towards values that compare lesser.
2323
#[unstable(feature = "step_trait", reason = "recently redesigned", issue = "42168")]
24-
#[const_trait]
25-
pub trait Step: ~const Clone + ~const PartialOrd + Sized {
24+
pub trait Step: Clone + PartialOrd + Sized {
2625
/// Returns the number of *successor* steps required to get from `start` to `end`.
2726
///
2827
/// Returns `None` if the number of steps would overflow `usize`
@@ -236,8 +235,7 @@ macro_rules! step_integer_impls {
236235
$(
237236
#[allow(unreachable_patterns)]
238237
#[unstable(feature = "step_trait", reason = "recently redesigned", issue = "42168")]
239-
#[rustc_const_unstable(feature = "const_iter", issue = "92476")]
240-
impl const Step for $u_narrower {
238+
impl Step for $u_narrower {
241239
step_identical_methods!();
242240

243241
#[inline]
@@ -269,8 +267,7 @@ macro_rules! step_integer_impls {
269267

270268
#[allow(unreachable_patterns)]
271269
#[unstable(feature = "step_trait", reason = "recently redesigned", issue = "42168")]
272-
#[rustc_const_unstable(feature = "const_iter", issue = "92476")]
273-
impl const Step for $i_narrower {
270+
impl Step for $i_narrower {
274271
step_identical_methods!();
275272

276273
#[inline]
@@ -334,8 +331,7 @@ macro_rules! step_integer_impls {
334331
$(
335332
#[allow(unreachable_patterns)]
336333
#[unstable(feature = "step_trait", reason = "recently redesigned", issue = "42168")]
337-
#[rustc_const_unstable(feature = "const_iter", issue = "92476")]
338-
impl const Step for $u_wider {
334+
impl Step for $u_wider {
339335
step_identical_methods!();
340336

341337
#[inline]
@@ -360,8 +356,7 @@ macro_rules! step_integer_impls {
360356

361357
#[allow(unreachable_patterns)]
362358
#[unstable(feature = "step_trait", reason = "recently redesigned", issue = "42168")]
363-
#[rustc_const_unstable(feature = "const_iter", issue = "92476")]
364-
impl const Step for $i_wider {
359+
impl Step for $i_wider {
365360
step_identical_methods!();
366361

367362
#[inline]
@@ -411,8 +406,7 @@ step_integer_impls! {
411406
}
412407

413408
#[unstable(feature = "step_trait", reason = "recently redesigned", issue = "42168")]
414-
#[rustc_const_unstable(feature = "const_iter", issue = "92476")]
415-
impl const Step for char {
409+
impl Step for char {
416410
#[inline]
417411
fn steps_between(&start: &char, &end: &char) -> Option<usize> {
418412
let start = start as u32;
@@ -430,7 +424,6 @@ impl const Step for char {
430424
}
431425

432426
#[inline]
433-
#[rustc_allow_const_fn_unstable(const_try)]
434427
fn forward_checked(start: char, count: usize) -> Option<char> {
435428
let start = start as u32;
436429
let mut res = Step::forward_checked(start, count)?;
@@ -447,7 +440,6 @@ impl const Step for char {
447440
}
448441

449442
#[inline]
450-
#[rustc_allow_const_fn_unstable(const_try)]
451443
fn backward_checked(start: char, count: usize) -> Option<char> {
452444
let start = start as u32;
453445
let mut res = Step::backward_checked(start, count)?;

library/core/src/iter/traits/marker.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,4 @@ pub unsafe trait InPlaceIterable: Iterator {}
8686
/// for details. Consumers are free to rely on the invariants in unsafe code.
8787
#[unstable(feature = "trusted_step", issue = "85731")]
8888
#[rustc_specialization_trait]
89-
#[const_trait]
90-
pub unsafe trait TrustedStep: ~const Step {}
89+
pub unsafe trait TrustedStep: Step {}

library/core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@
126126
#![feature(const_intrinsic_forget)]
127127
#![feature(const_ipv4)]
128128
#![feature(const_ipv6)]
129-
#![feature(const_iter)]
130129
#![feature(const_likely)]
131130
#![feature(const_maybe_uninit_uninit_array)]
132131
#![feature(const_maybe_uninit_as_mut_ptr)]

0 commit comments

Comments
 (0)