File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff 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) ) ]
656656fn 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) ) ]
677677fn test_rekillable_not_nested ( ) {
678678 do rekillable {
679679 // This should fail before
You can’t perform that action at this time.
0 commit comments