Constify Residual behind const_try

This commit is contained in:
onestacked 2022-09-23 20:17:31 +02:00
parent d78bc41785
commit 84666afb36
3 changed files with 5 additions and 2 deletions

View file

@ -126,6 +126,7 @@ impl<B, C> const ops::FromResidual for ControlFlow<B, C> {
} }
#[unstable(feature = "try_trait_v2_residual", issue = "91285")] #[unstable(feature = "try_trait_v2_residual", issue = "91285")]
#[rustc_const_unstable(feature = "const_try", issue = "74935")]
impl<B, C> const ops::Residual<C> for ControlFlow<B, convert::Infallible> { impl<B, C> const ops::Residual<C> for ControlFlow<B, convert::Infallible> {
type TryType = ControlFlow<B, C>; type TryType = ControlFlow<B, C>;
} }

View file

@ -2321,7 +2321,8 @@ impl<T> ops::FromResidual<ops::Yeet<()>> for Option<T> {
} }
#[unstable(feature = "try_trait_v2_residual", issue = "91285")] #[unstable(feature = "try_trait_v2_residual", issue = "91285")]
impl<T> ops::Residual<T> for Option<convert::Infallible> { #[rustc_const_unstable(feature = "const_try", issue = "74935")]
impl<T> const ops::Residual<T> for Option<convert::Infallible> {
type TryType = Option<T>; type TryType = Option<T>;
} }

View file

@ -2116,6 +2116,7 @@ impl<T, E, F: From<E>> ops::FromResidual<ops::Yeet<E>> for Result<T, F> {
} }
#[unstable(feature = "try_trait_v2_residual", issue = "91285")] #[unstable(feature = "try_trait_v2_residual", issue = "91285")]
impl<T, E> ops::Residual<T> for Result<convert::Infallible, E> { #[rustc_const_unstable(feature = "const_try", issue = "74935")]
impl<T, E> const ops::Residual<T> for Result<convert::Infallible, E> {
type TryType = Result<T, E>; type TryType = Result<T, E>;
} }