Skip to content

Commit 2337063

Browse files
authored
Rollup merge of #102144 - chriss0612:const_convert_control_flow, r=scottmcm
Extend const_convert with const {FormResidual, Try} for ControlFlow. Very small change so I just used the existing `const_convert` feature flag. #88674 Newly const API: ``` impl<B, C> const ops::Try for ControlFlow<B, C>; impl<B, C> const ops::FromResidual for ControlFlow<B, C>; ``` `@usbalbin` I hope it is ok that I added to your feature.
2 parents a99e675 + 5a5138d commit 2337063

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/core/src/ops/control_flow.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ pub enum ControlFlow<B, C = ()> {
9595
}
9696

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

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

116117
#[unstable(feature = "try_trait_v2", issue = "84277")]
117-
impl<B, C> ops::FromResidual for ControlFlow<B, C> {
118+
#[rustc_const_unstable(feature = "const_convert", issue = "88674")]
119+
impl<B, C> const ops::FromResidual for ControlFlow<B, C> {
118120
#[inline]
119121
fn from_residual(residual: ControlFlow<B, convert::Infallible>) -> Self {
120122
match residual {

0 commit comments

Comments
 (0)