Skip to content

Commit 0bd3dd8

Browse files
committed
Remove type parameter default from FromResidual
1 parent 730d5d4 commit 0bd3dd8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

library/core/src/ops/control_flow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl<B, C> ops::Try for ControlFlow<B, C> {
116116
}
117117

118118
#[unstable(feature = "try_trait_v2", issue = "84277")]
119-
impl<B, C> ops::FromResidual for ControlFlow<B, C> {
119+
impl<B, C> ops::FromResidual<ControlFlow<B, convert::Infallible>> for ControlFlow<B, C> {
120120
#[inline]
121121
fn from_residual(residual: ControlFlow<B, convert::Infallible>) -> Self {
122122
match residual {

library/core/src/ops/try_trait.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ use crate::ops::ControlFlow;
128128
)]
129129
#[doc(alias = "?")]
130130
#[lang = "Try"]
131-
pub trait Try: FromResidual {
131+
pub trait Try: FromResidual<Self::Residual> {
132132
/// The type of the value produced by `?` when *not* short-circuiting.
133133
#[unstable(feature = "try_trait_v2", issue = "84277")]
134134
type Output;
@@ -304,7 +304,7 @@ pub trait Try: FromResidual {
304304
)]
305305
#[rustc_diagnostic_item = "FromResidual"]
306306
#[unstable(feature = "try_trait_v2", issue = "84277")]
307-
pub trait FromResidual<R = <Self as Try>::Residual> {
307+
pub trait FromResidual<R> {
308308
/// Constructs the type from a compatible `Residual` type.
309309
///
310310
/// This should be implemented consistently with the `branch` method such
@@ -410,7 +410,7 @@ impl<T> Try for NeverShortCircuit<T> {
410410
}
411411
}
412412

413-
impl<T> FromResidual for NeverShortCircuit<T> {
413+
impl<T> FromResidual<NeverShortCircuitResidual> for NeverShortCircuit<T> {
414414
#[inline]
415415
fn from_residual(never: NeverShortCircuitResidual) -> Self {
416416
match never {}

library/core/src/option.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2495,7 +2495,7 @@ impl<T> ops::Try for Option<T> {
24952495
}
24962496

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

0 commit comments

Comments
 (0)