Skip to content

Commit

Permalink
Add a back-compat hack so that nightly code can still call `Try::into…
Browse files Browse the repository at this point in the history
…_result`
  • Loading branch information
scottmcm committed Feb 21, 2021
1 parent 507fa98 commit a77b588
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions library/core/src/ops/try.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ pub trait Try2021: FromResidual {
ControlFlow::Break(r) => FromResidual::from_residual(r),
}
}

/// Hack so that calls to `Try::into_result` keep building on nightly for a while
#[unstable(feature = "try_trait", issue = "42327")]
fn into_result(self) -> Result<<Self as Try2015>::Ok, <Self as Try2015>::Error>
where
Self: Try2015,
{
<Self as Try2015>::into_result(self)
}
}

/// Allows you to pick with other types can be converted into your `Try` type.
Expand Down

0 comments on commit a77b588

Please sign in to comment.