Skip to content

Commit 1a3a3df

Browse files
committed
Auto merge of #57322 - Centril:stabilize-identity, r=SimonSapin
Stabilize core::convert::identity r? @SimonSapin fixes #53500 This is waiting for FCP to complete but in the interim it would be good to review.
2 parents 1d029c6 + e75dab7 commit 1a3a3df

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/libcore/convert.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
/// Using `identity` to do nothing among other interesting functions:
5656
///
5757
/// ```rust
58-
/// #![feature(convert_id)]
5958
/// use std::convert::identity;
6059
///
6160
/// fn manipulation(x: u32) -> u32 {
@@ -69,7 +68,6 @@
6968
/// Using `identity` to get a function that changes nothing in a conditional:
7069
///
7170
/// ```rust
72-
/// #![feature(convert_id)]
7371
/// use std::convert::identity;
7472
///
7573
/// # let condition = true;
@@ -86,14 +84,13 @@
8684
/// Using `identity` to keep the `Some` variants of an iterator of `Option<T>`:
8785
///
8886
/// ```rust
89-
/// #![feature(convert_id)]
9087
/// use std::convert::identity;
9188
///
9289
/// let iter = vec![Some(1), None, Some(3)].into_iter();
9390
/// let filtered = iter.filter_map(identity).collect::<Vec<_>>();
9491
/// assert_eq!(vec![1, 3], filtered);
9592
/// ```
96-
#[unstable(feature = "convert_id", issue = "53500")]
93+
#[stable(feature = "convert_id", since = "1.33.0")]
9794
#[inline]
9895
pub const fn identity<T>(x: T) -> T { x }
9996

src/test/ui/rfc-2306/convert-id-const-with-gate.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
// compile-pass
44

5-
#![feature(convert_id)]
6-
75
fn main() {
86
const _FOO: u8 = ::std::convert::identity(42u8);
97
}

0 commit comments

Comments
 (0)