Skip to content

Commit a77b588

Browse files
committed
Add a back-compat hack so that nightly code can still call Try::into_result
1 parent 507fa98 commit a77b588

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

library/core/src/ops/try.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,15 @@ pub trait Try2021: FromResidual {
123123
ControlFlow::Break(r) => FromResidual::from_residual(r),
124124
}
125125
}
126+
127+
/// Hack so that calls to `Try::into_result` keep building on nightly for a while
128+
#[unstable(feature = "try_trait", issue = "42327")]
129+
fn into_result(self) -> Result<<Self as Try2015>::Ok, <Self as Try2015>::Error>
130+
where
131+
Self: Try2015,
132+
{
133+
<Self as Try2015>::into_result(self)
134+
}
126135
}
127136

128137
/// Allows you to pick with other types can be converted into your `Try` type.

0 commit comments

Comments
 (0)