Skip to content

Commit

Permalink
Remove type parameter default from FromResidual
Browse files Browse the repository at this point in the history
  • Loading branch information
zachs18 committed Aug 11, 2024
1 parent 730d5d4 commit 0bd3dd8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion library/core/src/ops/control_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ 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> {
impl<B, C> ops::FromResidual<ControlFlow<B, convert::Infallible>> for ControlFlow<B, C> {
#[inline]
fn from_residual(residual: ControlFlow<B, convert::Infallible>) -> Self {
match residual {
Expand Down
6 changes: 3 additions & 3 deletions library/core/src/ops/try_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ use crate::ops::ControlFlow;
)]
#[doc(alias = "?")]
#[lang = "Try"]
pub trait Try: FromResidual {
pub trait Try: FromResidual<Self::Residual> {
/// The type of the value produced by `?` when *not* short-circuiting.
#[unstable(feature = "try_trait_v2", issue = "84277")]
type Output;
Expand Down Expand Up @@ -304,7 +304,7 @@ pub trait Try: FromResidual {
)]
#[rustc_diagnostic_item = "FromResidual"]
#[unstable(feature = "try_trait_v2", issue = "84277")]
pub trait FromResidual<R = <Self as Try>::Residual> {
pub trait FromResidual<R> {
/// Constructs the type from a compatible `Residual` type.
///
/// This should be implemented consistently with the `branch` method such
Expand Down Expand Up @@ -410,7 +410,7 @@ impl<T> Try for NeverShortCircuit<T> {
}
}

impl<T> FromResidual for NeverShortCircuit<T> {
impl<T> FromResidual<NeverShortCircuitResidual> for NeverShortCircuit<T> {
#[inline]
fn from_residual(never: NeverShortCircuitResidual) -> Self {
match never {}
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2495,7 +2495,7 @@ impl<T> ops::Try for Option<T> {
}

#[unstable(feature = "try_trait_v2", issue = "84277")]
impl<T> ops::FromResidual for Option<T> {
impl<T> ops::FromResidual<Option<convert::Infallible>> for Option<T> {
#[inline]
fn from_residual(residual: Option<convert::Infallible>) -> Self {
match residual {
Expand Down

0 comments on commit 0bd3dd8

Please sign in to comment.