From 84666afb36365c3dafe0acfdcd17ea177f58af19 Mon Sep 17 00:00:00 2001 From: onestacked Date: Fri, 23 Sep 2022 20:17:31 +0200 Subject: [PATCH] Constify Residual behind const_try --- library/core/src/ops/control_flow.rs | 1 + library/core/src/option.rs | 3 ++- library/core/src/result.rs | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/library/core/src/ops/control_flow.rs b/library/core/src/ops/control_flow.rs index 8d236a9fecae..72ebe653caff 100644 --- a/library/core/src/ops/control_flow.rs +++ b/library/core/src/ops/control_flow.rs @@ -126,6 +126,7 @@ impl const ops::FromResidual for ControlFlow { } #[unstable(feature = "try_trait_v2_residual", issue = "91285")] +#[rustc_const_unstable(feature = "const_try", issue = "74935")] impl const ops::Residual for ControlFlow { type TryType = ControlFlow; } diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 934175863630..96b16b13256c 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -2321,7 +2321,8 @@ impl ops::FromResidual> for Option { } #[unstable(feature = "try_trait_v2_residual", issue = "91285")] -impl ops::Residual for Option { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const ops::Residual for Option { type TryType = Option; } diff --git a/library/core/src/result.rs b/library/core/src/result.rs index 76eaa191f781..dc90e90402c8 100644 --- a/library/core/src/result.rs +++ b/library/core/src/result.rs @@ -2116,6 +2116,7 @@ impl> ops::FromResidual> for Result { } #[unstable(feature = "try_trait_v2_residual", issue = "91285")] -impl ops::Residual for Result { +#[rustc_const_unstable(feature = "const_try", issue = "74935")] +impl const ops::Residual for Result { type TryType = Result; }