aboutsummaryrefslogtreecommitdiff
path: root/ctr-std/src/panic.rs
diff options
context:
space:
mode:
authorFenrir <[email protected]>2017-07-31 23:23:20 -0600
committerFenrir <[email protected]>2017-07-31 23:23:20 -0600
commit5f0fc0c00148c6128ee9354ba7360b386a59bef5 (patch)
tree3fe53b38fa6487a03c8938a1132e0e14f273d430 /ctr-std/src/panic.rs
parentMerge pull request #41 from FenrirWolf/panic-reboot (diff)
downloadctru-rs-5f0fc0c00148c6128ee9354ba7360b386a59bef5.tar.xz
ctru-rs-5f0fc0c00148c6128ee9354ba7360b386a59bef5.zip
Add unwinding strategy for panics
Diffstat (limited to 'ctr-std/src/panic.rs')
-rw-r--r--ctr-std/src/panic.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/ctr-std/src/panic.rs b/ctr-std/src/panic.rs
index 2e037cd..58356bc 100644
--- a/ctr-std/src/panic.rs
+++ b/ctr-std/src/panic.rs
@@ -22,8 +22,8 @@ use rc::Rc;
use sync::{Arc, Mutex, RwLock, atomic};
use thread::Result;
-//#[stable(feature = "panic_hooks", since = "1.10.0")]
-//pub use panicking::{take_hook, set_hook, PanicInfo, Location};
+#[stable(feature = "panic_hooks", since = "1.10.0")]
+pub use panicking::{take_hook, set_hook, PanicInfo, Location};
/// A marker trait which represents "panic safe" types in Rust.
///
@@ -112,7 +112,7 @@ pub trait UnwindSafe {}
/// This is a "helper marker trait" used to provide impl blocks for the
/// `UnwindSafe` trait, for more information see that documentation.
#[stable(feature = "catch_unwind", since = "1.9.0")]
-#[rustc_on_unimplemented = "the type {Self} contains interior mutability \
+#[rustc_on_unimplemented = "the type {Self} may contain interior mutability \
and a reference may not be safely transferrable \
across a catch_unwind boundary"]
pub trait RefUnwindSafe {}
@@ -388,7 +388,6 @@ pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
/// }
/// ```
#[stable(feature = "resume_unwind", since = "1.9.0")]
-// we always abort so I'm pretty sure there's no reason to ever call this
-pub fn resume_unwind(_payload: Box<Any + Send>) -> ! {
- unimplemented!()
+pub fn resume_unwind(payload: Box<Any + Send>) -> ! {
+ panicking::update_count_then_panic(payload)
}