diff --git a/src/libstd/rt/kill.rs b/src/libstd/rt/kill.rs index afef699390b7..94df621ce766 100644 --- a/src/libstd/rt/kill.rs +++ b/src/libstd/rt/kill.rs @@ -648,7 +648,9 @@ impl Death { #[inline] pub fn allow_kill(&mut self, already_failing: bool) { if self.unkillable == 0 { - fail!("illegal call of rekillable"); + // we need to decrement the counter before failing. + self.unkillable -= 1; + fail!("Cannot enter a rekillable() block without a surrounding unkillable()"); } self.unkillable -= 1; if self.unkillable == 0 { diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs index d094623b57ba..74e1af540c0a 100644 --- a/src/libstd/task/mod.rs +++ b/src/libstd/task/mod.rs @@ -651,8 +651,8 @@ fn test_kill_unkillable_task() { } } -#[ignore(reason = "linked failure")] #[test] +#[ignore(cfg(windows))] fn test_kill_rekillable_task() { use rt::test::*; @@ -672,8 +672,8 @@ fn test_kill_rekillable_task() { } #[test] -#[ignore(cfg(windows))] #[should_fail] +#[ignore(cfg(windows))] fn test_rekillable_not_nested() { do rekillable { // This should fail before