about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-09-02 17:08:56 +0200
committerGitHub <noreply@github.com>2025-09-02 17:08:56 +0200
commit90ed7913e50477b638bdba0ef06d1418f7538dc8 (patch)
treea522bceb1dde2104462929dcf1a87059c72a5cc6
parent353b4a0a10936093812ba156e2e1ce9ab290e8e7 (diff)
parent6be234074e454756d13cd3f969f427f94a5f4950 (diff)
downloadrust-90ed7913e50477b638bdba0ef06d1418f7538dc8.tar.gz
rust-90ed7913e50477b638bdba0ef06d1418f7538dc8.zip
Rollup merge of #146088 - npmccallum:try, r=scottmcm
constify impl Try for ControlFlow

Related to: https://github.com/rust-lang/rust/issues/74935
-rw-r--r--library/core/src/ops/control_flow.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/library/core/src/ops/control_flow.rs b/library/core/src/ops/control_flow.rs
index 7489a8bb6e7..73b74d53323 100644
--- a/library/core/src/ops/control_flow.rs
+++ b/library/core/src/ops/control_flow.rs
@@ -99,7 +99,8 @@ pub enum ControlFlow<B, C = ()> {
 }
 
 #[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
-impl<B, C> ops::Try for ControlFlow<B, C> {
+#[rustc_const_unstable(feature = "const_try", issue = "74935")]
+impl<B, C> const ops::Try for ControlFlow<B, C> {
     type Output = C;
     type Residual = ControlFlow<B, convert::Infallible>;
 
@@ -118,9 +119,10 @@ impl<B, C> ops::Try for ControlFlow<B, C> {
 }
 
 #[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
+#[rustc_const_unstable(feature = "const_try", issue = "74935")]
 // Note: manually specifying the residual type instead of using the default to work around
 // https://github.com/rust-lang/rust/issues/99940
-impl<B, C> ops::FromResidual<ControlFlow<B, convert::Infallible>> for ControlFlow<B, C> {
+impl<B, C> const ops::FromResidual<ControlFlow<B, convert::Infallible>> for ControlFlow<B, C> {
     #[inline]
     fn from_residual(residual: ControlFlow<B, convert::Infallible>) -> Self {
         match residual {