diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2019-03-16 14:11:23 +0300 |
|---|---|---|
| committer | Aleksey Kladov <aleksey.kladov@gmail.com> | 2019-03-16 14:11:23 +0300 |
| commit | 08f264d5762fc8cf817288084c03ce0d53ecb85b (patch) | |
| tree | ae3111a3a3a9b5877506322a72aeea4de1bae1cb | |
| parent | 52e885628e4317aa3f158622435927eb29b812e9 (diff) | |
| download | rust-08f264d5762fc8cf817288084c03ce0d53ecb85b.tar.gz rust-08f264d5762fc8cf817288084c03ce0d53ecb85b.zip | |
Stabilize Option::copied
closes https://github.com/rust-lang/rust/issues/57126
| -rw-r--r-- | src/libcore/option.rs | 8 | ||||
| -rw-r--r-- | src/libcore/tests/lib.rs | 1 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 46dfe28da62..f7f7e96fff3 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -881,15 +881,13 @@ impl<T: Copy> Option<&T> { /// # Examples /// /// ``` - /// #![feature(copied)] - /// /// let x = 12; /// let opt_x = Some(&x); /// assert_eq!(opt_x, Some(&12)); /// let copied = opt_x.copied(); /// assert_eq!(copied, Some(12)); /// ``` - #[unstable(feature = "copied", issue = "57126")] + #[stable(feature = "copied", since = "1.35.0")] pub fn copied(self) -> Option<T> { self.map(|&t| t) } @@ -902,15 +900,13 @@ impl<T: Copy> Option<&mut T> { /// # Examples /// /// ``` - /// #![feature(copied)] - /// /// let mut x = 12; /// let opt_x = Some(&mut x); /// assert_eq!(opt_x, Some(&mut 12)); /// let copied = opt_x.copied(); /// assert_eq!(copied, Some(12)); /// ``` - #[unstable(feature = "copied", issue = "57126")] + #[stable(feature = "copied", since = "1.35.0")] pub fn copied(self) -> Option<T> { self.map(|&mut t| t) } diff --git a/src/libcore/tests/lib.rs b/src/libcore/tests/lib.rs index d0021376389..a50310e195f 100644 --- a/src/libcore/tests/lib.rs +++ b/src/libcore/tests/lib.rs @@ -1,6 +1,5 @@ #![feature(box_syntax)] #![feature(cell_update)] -#![feature(copied)] #![feature(core_private_bignum)] #![feature(core_private_diy_float)] #![feature(dec2flt)] |
