Skip to content

Commit 5e80e0c

Browse files
committed
Decrement unkillable counter before failing
1 parent 5fc4045 commit 5e80e0c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/libstd/rt/kill.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,9 @@ impl Death {
648648
#[inline]
649649
pub fn allow_kill(&mut self, already_failing: bool) {
650650
if self.unkillable == 0 {
651-
fail!("illegal call of rekillable");
651+
// we need to decrement the counter before failing.
652+
self.unkillable -= 1;
653+
fail!("Cannot enter a rekillable() block without a surrounding unkillable()");
652654
}
653655
self.unkillable -= 1;
654656
if self.unkillable == 0 {

src/libstd/task/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,8 @@ fn test_kill_unkillable_task() {
651651
}
652652
}
653653

654-
#[ignore(reason = "linked failure")]
655654
#[test]
655+
#[ignore(cfg(windows))]
656656
fn test_kill_rekillable_task() {
657657
use rt::test::*;
658658

@@ -672,8 +672,8 @@ fn test_kill_rekillable_task() {
672672
}
673673

674674
#[test]
675-
#[ignore(cfg(windows))]
676675
#[should_fail]
676+
#[ignore(cfg(windows))]
677677
fn test_rekillable_not_nested() {
678678
do rekillable {
679679
// This should fail before

0 commit comments

Comments
 (0)