Skip to content

Commit d2d44f6

Browse files
authored
Rollup merge of #98204 - Kixiron:stable-unzip, r=thomcc
Stabilize `Option::unzip()` Stabilizes `Option::unzip()`, closes #87800 ```@rustbot``` modify labels: +T-libs-api
2 parents 31d754a + df8a62d commit d2d44f6

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
@@ -1713,17 +1713,20 @@ impl<T, U> Option<(T, U)> {
17131713
/// # Examples
17141714
///
17151715
/// ```
1716-
/// #![feature(unzip_option)]
1717-
///
17181716
/// let x = Some((1, "hi"));
17191717
/// let y = None::<(u8, u32)>;
17201718
///
17211719
/// assert_eq!(x.unzip(), (Some(1), Some("hi")));
17221720
/// assert_eq!(y.unzip(), (None, None));
17231721
/// ```
17241722
#[inline]
1725-
#[unstable(feature = "unzip_option", issue = "87800", reason = "recently added")]
1726-
pub const fn unzip(self) -> (Option<T>, Option<U>) {
1723+
#[stable(feature = "unzip_option", since = "CURRENT_RUSTC_VERSION")]
1724+
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
1725+
pub const fn unzip(self) -> (Option<T>, Option<U>)
1726+
where
1727+
T: ~const Destruct,
1728+
U: ~const Destruct,
1729+
{
17271730
match self {
17281731
Some((a, b)) => (Some(a), Some(b)),
17291732
None => (None, None),

library/core/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
#![feature(strict_provenance_atomic_ptr)]
9696
#![feature(trusted_random_access)]
9797
#![feature(unsize)]
98-
#![feature(unzip_option)]
9998
#![feature(const_array_from_ref)]
10099
#![feature(const_slice_from_ref)]
101100
#![feature(waker_getters)]

0 commit comments

Comments
 (0)