Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fcbdcae

Browse files
committedJul 27, 2024
stabilize is_sorted
1 parent 339f756 commit fcbdcae

File tree

4 files changed

+6
-19
lines changed

4 files changed

+6
-19
lines changed
 

‎alloc/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
// tidy-alphabetical-start
9393
#![cfg_attr(not(no_global_oom_handling), feature(const_alloc_error))]
9494
#![cfg_attr(not(no_global_oom_handling), feature(const_btree_len))]
95-
#![cfg_attr(test, feature(is_sorted))]
9695
#![cfg_attr(test, feature(new_uninit))]
9796
#![feature(alloc_layout_extra)]
9897
#![feature(allocator_api)]

‎core/src/iter/traits/iterator.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -3951,16 +3951,14 @@ pub trait Iterator {
39513951
/// # Examples
39523952
///
39533953
/// ```
3954-
/// #![feature(is_sorted)]
3955-
///
39563954
/// assert!([1, 2, 2, 9].iter().is_sorted());
39573955
/// assert!(![1, 3, 2, 4].iter().is_sorted());
39583956
/// assert!([0].iter().is_sorted());
39593957
/// assert!(std::iter::empty::<i32>().is_sorted());
39603958
/// assert!(![0.0, 1.0, f32::NAN].iter().is_sorted());
39613959
/// ```
39623960
#[inline]
3963-
#[unstable(feature = "is_sorted", reason = "new API", issue = "53485")]
3961+
#[stable(feature = "is_sorted", since = "CURRENT_RUSTC_VERSION")]
39643962
#[rustc_do_not_const_check]
39653963
fn is_sorted(self) -> bool
39663964
where
@@ -3978,8 +3976,6 @@ pub trait Iterator {
39783976
/// # Examples
39793977
///
39803978
/// ```
3981-
/// #![feature(is_sorted)]
3982-
///
39833979
/// assert!([1, 2, 2, 9].iter().is_sorted_by(|a, b| a <= b));
39843980
/// assert!(![1, 2, 2, 9].iter().is_sorted_by(|a, b| a < b));
39853981
///
@@ -3989,7 +3985,7 @@ pub trait Iterator {
39893985
/// assert!(std::iter::empty::<i32>().is_sorted_by(|a, b| false));
39903986
/// assert!(std::iter::empty::<i32>().is_sorted_by(|a, b| true));
39913987
/// ```
3992-
#[unstable(feature = "is_sorted", reason = "new API", issue = "53485")]
3988+
#[stable(feature = "is_sorted", since = "CURRENT_RUSTC_VERSION")]
39933989
#[rustc_do_not_const_check]
39943990
fn is_sorted_by<F>(mut self, compare: F) -> bool
39953991
where
@@ -4030,13 +4026,11 @@ pub trait Iterator {
40304026
/// # Examples
40314027
///
40324028
/// ```
4033-
/// #![feature(is_sorted)]
4034-
///
40354029
/// assert!(["c", "bb", "aaa"].iter().is_sorted_by_key(|s| s.len()));
40364030
/// assert!(![-2i32, -1, 0, 3].iter().is_sorted_by_key(|n| n.abs()));
40374031
/// ```
40384032
#[inline]
4039-
#[unstable(feature = "is_sorted", reason = "new API", issue = "53485")]
4033+
#[stable(feature = "is_sorted", since = "CURRENT_RUSTC_VERSION")]
40404034
#[rustc_do_not_const_check]
40414035
fn is_sorted_by_key<F, K>(self, f: F) -> bool
40424036
where

‎core/src/slice/mod.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -4069,7 +4069,6 @@ impl<T> [T] {
40694069
/// # Examples
40704070
///
40714071
/// ```
4072-
/// #![feature(is_sorted)]
40734072
/// let empty: [i32; 0] = [];
40744073
///
40754074
/// assert!([1, 2, 2, 9].is_sorted());
@@ -4079,7 +4078,7 @@ impl<T> [T] {
40794078
/// assert!(![0.0, 1.0, f32::NAN].is_sorted());
40804079
/// ```
40814080
#[inline]
4082-
#[unstable(feature = "is_sorted", reason = "new API", issue = "53485")]
4081+
#[stable(feature = "is_sorted", since = "CURRENT_RUSTC_VERSION")]
40834082
#[must_use]
40844083
pub fn is_sorted(&self) -> bool
40854084
where
@@ -4096,8 +4095,6 @@ impl<T> [T] {
40964095
/// # Examples
40974096
///
40984097
/// ```
4099-
/// #![feature(is_sorted)]
4100-
///
41014098
/// assert!([1, 2, 2, 9].is_sorted_by(|a, b| a <= b));
41024099
/// assert!(![1, 2, 2, 9].is_sorted_by(|a, b| a < b));
41034100
///
@@ -4108,7 +4105,7 @@ impl<T> [T] {
41084105
/// assert!(empty.is_sorted_by(|a, b| false));
41094106
/// assert!(empty.is_sorted_by(|a, b| true));
41104107
/// ```
4111-
#[unstable(feature = "is_sorted", reason = "new API", issue = "53485")]
4108+
#[stable(feature = "is_sorted", since = "CURRENT_RUSTC_VERSION")]
41124109
#[must_use]
41134110
pub fn is_sorted_by<'a, F>(&'a self, mut compare: F) -> bool
41144111
where
@@ -4128,13 +4125,11 @@ impl<T> [T] {
41284125
/// # Examples
41294126
///
41304127
/// ```
4131-
/// #![feature(is_sorted)]
4132-
///
41334128
/// assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
41344129
/// assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
41354130
/// ```
41364131
#[inline]
4137-
#[unstable(feature = "is_sorted", reason = "new API", issue = "53485")]
4132+
#[stable(feature = "is_sorted", since = "CURRENT_RUSTC_VERSION")]
41384133
#[must_use]
41394134
pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
41404135
where

‎core/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#![feature(hasher_prefixfree_extras)]
4545
#![feature(hashmap_internals)]
4646
#![feature(try_find)]
47-
#![feature(is_sorted)]
4847
#![feature(layout_for_ptr)]
4948
#![feature(pattern)]
5049
#![feature(slice_take)]

0 commit comments

Comments
 (0)
Failed to load comments.