Skip to content

Commit 6be2340

Browse files
committed
constify impl Try for ControlFlow
1 parent 84a1747 commit 6be2340

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/core/src/ops/control_flow.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ pub enum ControlFlow<B, C = ()> {
9999
}
100100

101101
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
102-
impl<B, C> ops::Try for ControlFlow<B, C> {
102+
#[rustc_const_unstable(feature = "const_try", issue = "74935")]
103+
impl<B, C> const ops::Try for ControlFlow<B, C> {
103104
type Output = C;
104105
type Residual = ControlFlow<B, convert::Infallible>;
105106

@@ -118,9 +119,10 @@ impl<B, C> ops::Try for ControlFlow<B, C> {
118119
}
119120

120121
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
122+
#[rustc_const_unstable(feature = "const_try", issue = "74935")]
121123
// Note: manually specifying the residual type instead of using the default to work around
122124
// https://github.com/rust-lang/rust/issues/99940
123-
impl<B, C> ops::FromResidual<ControlFlow<B, convert::Infallible>> for ControlFlow<B, C> {
125+
impl<B, C> const ops::FromResidual<ControlFlow<B, convert::Infallible>> for ControlFlow<B, C> {
124126
#[inline]
125127
fn from_residual(residual: ControlFlow<B, convert::Infallible>) -> Self {
126128
match residual {

0 commit comments

Comments
 (0)