Skip to content

Commit f075698

Browse files
committed
Auto merge of #31728 - Amanieu:recoversafe_into_inner, r=alexcrichton
This allows a `FnOnce` to be wrapped in an `AssertRecoverSafe`.
2 parents 7dd3b20 + b6a65df commit f075698

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libstd/panic.rs

+6
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@ impl<T> AssertRecoverSafe<T> {
193193
pub fn new(t: T) -> AssertRecoverSafe<T> {
194194
AssertRecoverSafe(t)
195195
}
196+
197+
/// Consumes the `AssertRecoverSafe`, returning the wrapped value.
198+
#[unstable(feature = "recover", reason = "awaiting feedback", issue = "27719")]
199+
pub fn into_inner(self) -> T {
200+
self.0
201+
}
196202
}
197203

198204
impl<T> Deref for AssertRecoverSafe<T> {

0 commit comments

Comments
 (0)