about summary refs log tree commit diff
path: root/src/libstd/panic.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/panic.rs')
-rw-r--r--src/libstd/panic.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/libstd/panic.rs b/src/libstd/panic.rs
index 5c2e36623cb..aff11d036f8 100644
--- a/src/libstd/panic.rs
+++ b/src/libstd/panic.rs
@@ -23,7 +23,21 @@ use sync::{Arc, Mutex, RwLock};
 use sys_common::unwind;
 use thread::Result;
 
-pub use panicking::{take_handler, set_handler, PanicInfo, Location};
+pub use panicking::{take_hook, set_hook, PanicInfo, Location};
+
+///
+#[rustc_deprecated(since = "1.9.0", reason = "renamed to set_hook")]
+#[unstable(feature = "panic_handler", reason = "awaiting feedback", issue = "30449")]
+pub fn set_handler<F>(handler: F) where F: Fn(&PanicInfo) + 'static + Sync + Send {
+    set_hook(Box::new(handler))
+}
+
+///
+#[rustc_deprecated(since = "1.9.0", reason = "renamed to take_hook")]
+#[unstable(feature = "panic_handler", reason = "awaiting feedback", issue = "30449")]
+pub fn take_handler() -> Box<Fn(&PanicInfo) + 'static + Sync + Send> {
+    take_hook()
+}
 
 /// A marker trait which represents "panic safe" types in Rust.
 ///