Skip to content

Commit

Permalink
Constify {FormResidual, Try} for ControlFlow
Browse files Browse the repository at this point in the history
  • Loading branch information
onestacked committed Sep 22, 2022
1 parent 8ab71ab commit 5a5138d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/core/src/ops/control_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ pub enum ControlFlow<B, C = ()> {
}

#[unstable(feature = "try_trait_v2", issue = "84277")]
impl<B, C> ops::Try for ControlFlow<B, C> {
#[rustc_const_unstable(feature = "const_convert", issue = "88674")]
impl<B, C> const ops::Try for ControlFlow<B, C> {
type Output = C;
type Residual = ControlFlow<B, convert::Infallible>;

Expand All @@ -114,7 +115,8 @@ impl<B, C> ops::Try for ControlFlow<B, C> {
}

#[unstable(feature = "try_trait_v2", issue = "84277")]
impl<B, C> ops::FromResidual for ControlFlow<B, C> {
#[rustc_const_unstable(feature = "const_convert", issue = "88674")]
impl<B, C> const ops::FromResidual for ControlFlow<B, C> {
#[inline]
fn from_residual(residual: ControlFlow<B, convert::Infallible>) -> Self {
match residual {
Expand Down

0 comments on commit 5a5138d

Please sign in to comment.