about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-01-14 10:22:22 +0000
committerbors <bors@rust-lang.org>2019-01-14 10:22:22 +0000
commit1a3a3dfcdd7faf0b8ab266a79a4a35ab30e5136a (patch)
tree7c2943e7154864734546b76e5cbe1bd74cba2c27
parent1d029c67e22b272ecc7a32044710600bfa3578e5 (diff)
parente75dab7f67338a525e5fc47ed5ed9e99ea20414c (diff)
downloadrust-1a3a3dfcdd7faf0b8ab266a79a4a35ab30e5136a.tar.gz
rust-1a3a3dfcdd7faf0b8ab266a79a4a35ab30e5136a.zip
Auto merge of #57322 - Centril:stabilize-identity, r=SimonSapin
Stabilize core::convert::identity

r? @SimonSapin

fixes https://github.com/rust-lang/rust/issues/53500

This is waiting for FCP to complete but in the interim it would be good to review.
-rw-r--r--src/libcore/convert.rs5
-rw-r--r--src/test/ui/rfc-2306/convert-id-const-with-gate.rs2
2 files changed, 1 insertions, 6 deletions
diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs
index 5bf5c858f86..08b5ac06f72 100644
--- a/src/libcore/convert.rs
+++ b/src/libcore/convert.rs
@@ -55,7 +55,6 @@
 /// Using `identity` to do nothing among other interesting functions:
 ///
 /// ```rust
-/// #![feature(convert_id)]
 /// use std::convert::identity;
 ///
 /// fn manipulation(x: u32) -> u32 {
@@ -69,7 +68,6 @@
 /// Using `identity` to get a function that changes nothing in a conditional:
 ///
 /// ```rust
-/// #![feature(convert_id)]
 /// use std::convert::identity;
 ///
 /// # let condition = true;
@@ -86,14 +84,13 @@
 /// Using `identity` to keep the `Some` variants of an iterator of `Option<T>`:
 ///
 /// ```rust
-/// #![feature(convert_id)]
 /// use std::convert::identity;
 ///
 /// let iter = vec![Some(1), None, Some(3)].into_iter();
 /// let filtered = iter.filter_map(identity).collect::<Vec<_>>();
 /// assert_eq!(vec![1, 3], filtered);
 /// ```
-#[unstable(feature = "convert_id", issue = "53500")]
+#[stable(feature = "convert_id", since = "1.33.0")]
 #[inline]
 pub const fn identity<T>(x: T) -> T { x }
 
diff --git a/src/test/ui/rfc-2306/convert-id-const-with-gate.rs b/src/test/ui/rfc-2306/convert-id-const-with-gate.rs
index 0128fc2b35d..a82feb961f7 100644
--- a/src/test/ui/rfc-2306/convert-id-const-with-gate.rs
+++ b/src/test/ui/rfc-2306/convert-id-const-with-gate.rs
@@ -2,8 +2,6 @@
 
 // compile-pass
 
-#![feature(convert_id)]
-
 fn main() {
     const _FOO: u8 = ::std::convert::identity(42u8);
 }