diff options
| author | kennytm <kennytm@gmail.com> | 2019-03-16 22:42:00 +0800 |
|---|---|---|
| committer | kennytm <kennytm@gmail.com> | 2019-03-16 22:42:00 +0800 |
| commit | 7c009a4df7214290e6e5cf73d5bd5652fa8015dc (patch) | |
| tree | 0d1a620d973a7dff4f6ca02a51bdd3e4814ba5c9 /src/libcore | |
| parent | 40d277e3b7812d236891ec6a77fcd24279180f0e (diff) | |
| parent | 08f264d5762fc8cf817288084c03ce0d53ecb85b (diff) | |
| download | rust-7c009a4df7214290e6e5cf73d5bd5652fa8015dc.tar.gz rust-7c009a4df7214290e6e5cf73d5bd5652fa8015dc.zip | |
Rollup merge of #59231 - matklad:copied, r=Centril
Stabilize Option::copied closes https://github.com/rust-lang/rust/issues/57126
Diffstat (limited to 'src/libcore')
| -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 75fa24aa4dc..dfc388409a8 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)] |
