From 649c648d6f0627df9ac272b1505e363c7dbd656f Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 2 Jan 2014 18:39:51 -0800 Subject: Abort on double-failure. #910 Previously this was an rtabort!, indicating a runtime bug. Promote this to a more intentional abort and print a (slightly) more informative error message. Can't test this sense our test suite can't handle an abort exit. --- src/libstd/rt/unwind.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/libstd/rt') diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs index 358df7260f4..6be4ab97ee3 100644 --- a/src/libstd/rt/unwind.rs +++ b/src/libstd/rt/unwind.rs @@ -354,7 +354,13 @@ pub fn begin_unwind(msg: M, file: &'static str, line: uint) -> ! } if (*task).unwinder.unwinding { - rtabort!("unwinding again"); + // If a task fails while it's already unwinding then we + // have limited options. Currently our preference is to + // just abort. In the future we may consider resuming + // unwinding or otherwise exiting the task cleanly. + rterrln!("task failed during unwinding (double-failure - total drag!)") + rterrln!("rust must abort now. so sorry."); + intrinsics::abort(); } } -- cgit 1.4.1-3-g733a5