rollup merge of #18442 : Manishearth/rust_panic

This commit is contained in:
Alex Crichton 2014-10-30 08:58:04 -07:00
commit d7ee04c5c4
2 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@ release: 0.12.0
``` ```
Finally, if you can run the offending command under gdb, pasting a stack trace can be Finally, if you can run the offending command under gdb, pasting a stack trace can be
useful; to do so, you will need to set a breakpoint on `rust_fail`. useful; to do so, you will need to set a breakpoint on `rust_panic`.
# I submitted a bug, but nobody has commented on it! # I submitted a bug, but nobody has commented on it!

View File

@ -177,7 +177,7 @@ pub unsafe fn try(f: ||) -> ::core::result::Result<(), Box<Any + Send>> {
// An uninlined, unmangled function upon which to slap yer breakpoints // An uninlined, unmangled function upon which to slap yer breakpoints
#[inline(never)] #[inline(never)]
#[no_mangle] #[no_mangle]
fn rust_fail(cause: Box<Any + Send>) -> ! { fn rust_panic(cause: Box<Any + Send>) -> ! {
rtdebug!("begin_unwind()"); rtdebug!("begin_unwind()");
unsafe { unsafe {
@ -588,7 +588,7 @@ fn begin_unwind_inner(msg: Box<Any + Send>, file_line: &(&'static str, uint)) ->
// (hopefully someone printed something about this). // (hopefully someone printed something about this).
let mut task: Box<Task> = match Local::try_take() { let mut task: Box<Task> = match Local::try_take() {
Some(task) => task, Some(task) => task,
None => rust_fail(msg), None => rust_panic(msg),
}; };
if task.unwinder.unwinding { if task.unwinder.unwinding {
@ -605,7 +605,7 @@ fn begin_unwind_inner(msg: Box<Any + Send>, file_line: &(&'static str, uint)) ->
// requires the task. We need a handle to its unwinder, however, so after // requires the task. We need a handle to its unwinder, however, so after
// this we unsafely extract it and continue along. // this we unsafely extract it and continue along.
Local::put(task); Local::put(task);
rust_fail(msg); rust_panic(msg);
} }
/// Register a callback to be invoked when a task unwinds. /// Register a callback to be invoked when a task unwinds.