about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-02-18 10:35:25 +0000
committerbors <bors@rust-lang.org>2016-02-18 10:35:25 +0000
commitf075698ea59794f3ece46c365b8071d844adb6c0 (patch)
treedfc4e80e445c57e43aa3048fa9b318d228c76030 /src/libstd
parent7dd3b20119e1830d27c06ca518eb1addff674d85 (diff)
parentb6a65df6d5d458de0eb96641e4f3cc3497172844 (diff)
downloadrust-f075698ea59794f3ece46c365b8071d844adb6c0.tar.gz
rust-f075698ea59794f3ece46c365b8071d844adb6c0.zip
Auto merge of #31728 - Amanieu:recoversafe_into_inner, r=alexcrichton
This allows a `FnOnce` to be wrapped in an `AssertRecoverSafe`.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/panic.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstd/panic.rs b/src/libstd/panic.rs
index 83df54f1830..69a1b57a0c5 100644
--- a/src/libstd/panic.rs
+++ b/src/libstd/panic.rs
@@ -193,6 +193,12 @@ impl<T> AssertRecoverSafe<T> {
     pub fn new(t: T) -> AssertRecoverSafe<T> {
         AssertRecoverSafe(t)
     }
+
+    /// Consumes the `AssertRecoverSafe`, returning the wrapped value.
+    #[unstable(feature = "recover", reason = "awaiting feedback", issue = "27719")]
+    pub fn into_inner(self) -> T {
+        self.0
+    }
 }
 
 impl<T> Deref for AssertRecoverSafe<T> {