]> git.lizzy.rs Git - rust.git/commitdiff
Constly impl TryV2 and Residual for Option
authorAlbin Hedman <albin9604@gmail.com>
Sun, 4 Jul 2021 17:10:21 +0000 (19:10 +0200)
committerAlbin Hedman <albin9604@gmail.com>
Wed, 15 Sep 2021 14:58:00 +0000 (16:58 +0200)
library/core/src/option.rs

index 907726f0c345c8a3736cbae493697e861aba609c..b61ab393bf9142e4aef9e877cee9a0134cbba09f 100644 (file)
@@ -2010,7 +2010,8 @@ fn from_iter<I: IntoIterator<Item = Option<A>>>(iter: I) -> Option<V> {
 }
 
 #[unstable(feature = "try_trait_v2", issue = "84277")]
-impl<T> ops::Try for Option<T> {
+#[rustc_const_unstable(feature = "const_convert", issue = "none")]
+impl<T> const ops::Try for Option<T> {
     type Output = T;
     type Residual = Option<convert::Infallible>;
 
@@ -2029,7 +2030,8 @@ fn branch(self) -> ControlFlow<Self::Residual, Self::Output> {
 }
 
 #[unstable(feature = "try_trait_v2", issue = "84277")]
-impl<T> ops::FromResidual for Option<T> {
+#[rustc_const_unstable(feature = "const_convert", issue = "none")]
+impl<T> const ops::FromResidual for Option<T> {
     #[inline]
     fn from_residual(residual: Option<convert::Infallible>) -> Self {
         match residual {