Rollup merge of #98204 - Kixiron:stable-unzip, r=thomcc
Stabilize `Option::unzip()` Stabilizes `Option::unzip()`, closes #87800 ```@rustbot``` modify labels: +T-libs-api
This commit is contained in:
commit
d2d44f619f
@ -1713,8 +1713,6 @@ impl<T, U> Option<(T, U)> {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #![feature(unzip_option)]
|
|
||||||
///
|
|
||||||
/// let x = Some((1, "hi"));
|
/// let x = Some((1, "hi"));
|
||||||
/// let y = None::<(u8, u32)>;
|
/// let y = None::<(u8, u32)>;
|
||||||
///
|
///
|
||||||
@ -1722,8 +1720,13 @@ impl<T, U> Option<(T, U)> {
|
|||||||
/// assert_eq!(y.unzip(), (None, None));
|
/// assert_eq!(y.unzip(), (None, None));
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
#[unstable(feature = "unzip_option", issue = "87800", reason = "recently added")]
|
#[stable(feature = "unzip_option", since = "CURRENT_RUSTC_VERSION")]
|
||||||
pub const fn unzip(self) -> (Option<T>, Option<U>) {
|
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
|
||||||
|
pub const fn unzip(self) -> (Option<T>, Option<U>)
|
||||||
|
where
|
||||||
|
T: ~const Destruct,
|
||||||
|
U: ~const Destruct,
|
||||||
|
{
|
||||||
match self {
|
match self {
|
||||||
Some((a, b)) => (Some(a), Some(b)),
|
Some((a, b)) => (Some(a), Some(b)),
|
||||||
None => (None, None),
|
None => (None, None),
|
||||||
|
@ -95,7 +95,6 @@
|
|||||||
#![feature(strict_provenance_atomic_ptr)]
|
#![feature(strict_provenance_atomic_ptr)]
|
||||||
#![feature(trusted_random_access)]
|
#![feature(trusted_random_access)]
|
||||||
#![feature(unsize)]
|
#![feature(unsize)]
|
||||||
#![feature(unzip_option)]
|
|
||||||
#![feature(const_array_from_ref)]
|
#![feature(const_array_from_ref)]
|
||||||
#![feature(const_slice_from_ref)]
|
#![feature(const_slice_from_ref)]
|
||||||
#![feature(waker_getters)]
|
#![feature(waker_getters)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user