Skip to content

Commit

Permalink
Constly impl TryV2 and FromResidual for Result
Browse files Browse the repository at this point in the history
  • Loading branch information
usbalbin committed Sep 15, 2021
1 parent b85107e commit 88258c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/core/src/result.rs
Expand Up @@ -1889,7 +1889,8 @@ impl<A, E, V: FromIterator<A>> FromIterator<Result<A, E>> for Result<V, E> {
}

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

Expand All @@ -1908,7 +1909,8 @@ impl<T, E> ops::Try for Result<T, E> {
}

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

0 comments on commit 88258c0

Please sign in to comment.