Skip to content

Commit

Permalink
Constly impl TryV2 and Residual for Option
Browse files Browse the repository at this point in the history
  • Loading branch information
usbalbin committed Aug 2, 2021
1 parent 7fe6993 commit 7c8c209
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1972,7 +1972,8 @@ impl<A, V: FromIterator<A>> FromIterator<Option<A>> for Option<V> {
}

#[unstable(feature = "try_trait_v2", issue = "84277")]
impl<T> ops::TryV2 for Option<T> {
#[rustc_const_unstable(feature = "const_identity_convert", issue = "none")]
impl<T> const ops::TryV2 for Option<T> {
type Output = T;
type Residual = Option<convert::Infallible>;

Expand All @@ -1991,7 +1992,8 @@ impl<T> ops::TryV2 for Option<T> {
}

#[unstable(feature = "try_trait_v2", issue = "84277")]
impl<T> ops::FromResidual for Option<T> {
#[rustc_const_unstable(feature = "const_identity_convert", issue = "none")]
impl<T> const ops::FromResidual for Option<T> {
#[inline]
fn from_residual(residual: Option<convert::Infallible>) -> Self {
match residual {
Expand Down

0 comments on commit 7c8c209

Please sign in to comment.