Skip to content

Commit 59be3e8

Browse files
committed
Stabilized Option::unzip()
1 parent 949a64a commit 59be3e8

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

library/core/src/option.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -1711,17 +1711,20 @@ impl<T, U> Option<(T, U)> {
17111711
/// # Examples
17121712
///
17131713
/// ```
1714-
/// #![feature(unzip_option)]
1715-
///
17161714
/// let x = Some((1, "hi"));
17171715
/// let y = None::<(u8, u32)>;
17181716
///
17191717
/// assert_eq!(x.unzip(), (Some(1), Some("hi")));
17201718
/// assert_eq!(y.unzip(), (None, None));
17211719
/// ```
17221720
#[inline]
1723-
#[unstable(feature = "unzip_option", issue = "87800", reason = "recently added")]
1724-
pub const fn unzip(self) -> (Option<T>, Option<U>) {
1721+
#[stable(feature = "unzip_option", since = "1.63.0")]
1722+
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
1723+
pub const fn unzip(self) -> (Option<T>, Option<U>)
1724+
where
1725+
T: ~const Destruct,
1726+
U: ~const Destruct,
1727+
{
17251728
match self {
17261729
Some((a, b)) => (Some(a), Some(b)),
17271730
None => (None, None),

library/core/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
#![feature(strict_provenance)]
9292
#![feature(trusted_random_access)]
9393
#![feature(unsize)]
94-
#![feature(unzip_option)]
9594
#![feature(const_array_from_ref)]
9695
#![feature(const_slice_from_ref)]
9796
#![feature(waker_getters)]

0 commit comments

Comments
 (0)