mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-27 07:03:45 +00:00
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.
This commit is contained in:
commit
23370637ef
@ -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>;
|
||||
|
||||
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user