Skip to content

Commit cbec40f

Browse files
committed
Remove FromResidual param default
1 parent 4056082 commit cbec40f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/rustc_middle/src/mir/interpret/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ impl<'tcx, T> ops::Residual<T> for InterpResult<'tcx, convert::Infallible> {
817817
type TryType = InterpResult<'tcx, T>;
818818
}
819819

820-
impl<'tcx, T> ops::FromResidual for InterpResult<'tcx, T> {
820+
impl<'tcx, T> ops::FromResidual<InterpResult<'tcx, convert::Infallible>> for InterpResult<'tcx, T> {
821821
#[inline]
822822
#[track_caller]
823823
fn from_residual(residual: InterpResult<'tcx, convert::Infallible>) -> Self {

library/core/src/ops/try_trait.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ use crate::ops::ControlFlow;
129129
#[doc(alias = "?")]
130130
#[lang = "Try"]
131131
#[rustc_const_unstable(feature = "const_try", issue = "74935")]
132-
pub const trait Try: [const] FromResidual {
132+
pub const trait Try: [const] FromResidual<Self::Residual> {
133133
/// The type of the value produced by `?` when *not* short-circuiting.
134134
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
135135
type Output;
@@ -306,7 +306,7 @@ pub const trait Try: [const] FromResidual {
306306
#[rustc_diagnostic_item = "FromResidual"]
307307
#[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")]
308308
#[rustc_const_unstable(feature = "const_try", issue = "74935")]
309-
pub const trait FromResidual<R = <Self as Try>::Residual> {
309+
pub const trait FromResidual<R> {
310310
/// Constructs the type from a compatible `Residual` type.
311311
///
312312
/// This should be implemented consistently with the `branch` method such
@@ -416,7 +416,7 @@ impl<T> Try for NeverShortCircuit<T> {
416416
}
417417
}
418418

419-
impl<T> FromResidual for NeverShortCircuit<T> {
419+
impl<T> FromResidual<NeverShortCircuitResidual> for NeverShortCircuit<T> {
420420
#[inline]
421421
fn from_residual(never: NeverShortCircuitResidual) -> Self {
422422
match never {}

0 commit comments

Comments
 (0)