@@ -328,7 +328,7 @@ impl KillHandle {
328
328
}
329
329
330
330
// Try to see if all our children are gone already.
331
- match unsafe { self . try_unwrap ( ) } {
331
+ match self . try_unwrap ( ) {
332
332
// Couldn't unwrap; children still alive. Reparent entire handle as
333
333
// our own tombstone, to be unwrapped later.
334
334
Left ( this) => {
@@ -340,7 +340,7 @@ impl KillHandle {
340
340
// Prefer to check tombstones that were there first,
341
341
// being "more fair" at the expense of tail-recursion.
342
342
others. take ( ) . map_consume_default ( true , |f| f ( ) ) && {
343
- let mut inner = unsafe { this. take ( ) . unwrap ( ) } ;
343
+ let mut inner = this. take ( ) . unwrap ( ) ;
344
344
( !inner. any_child_failed ) &&
345
345
inner. child_tombstones . take_map_default ( true , |f| f ( ) )
346
346
}
@@ -429,7 +429,7 @@ impl Death {
429
429
do self. on_exit . take_map |on_exit| {
430
430
if success {
431
431
// We succeeded, but our children might not. Need to wait for them.
432
- let mut inner = unsafe { self . kill_handle . take_unwrap ( ) . unwrap ( ) } ;
432
+ let mut inner = self . kill_handle . take_unwrap ( ) . unwrap ( ) ;
433
433
if inner. any_child_failed {
434
434
success = false ;
435
435
} else {
@@ -555,7 +555,7 @@ mod test {
555
555
556
556
// Without another handle to child, the try unwrap should succeed.
557
557
child. reparent_children_to ( & mut parent) ;
558
- let mut parent_inner = unsafe { parent. unwrap ( ) } ;
558
+ let mut parent_inner = parent. unwrap ( ) ;
559
559
assert ! ( parent_inner. child_tombstones. is_none( ) ) ;
560
560
assert ! ( parent_inner. any_child_failed == false ) ;
561
561
}
@@ -570,7 +570,7 @@ mod test {
570
570
child. notify_immediate_failure ( ) ;
571
571
// Without another handle to child, the try unwrap should succeed.
572
572
child. reparent_children_to ( & mut parent) ;
573
- let mut parent_inner = unsafe { parent. unwrap ( ) } ;
573
+ let mut parent_inner = parent. unwrap ( ) ;
574
574
assert ! ( parent_inner. child_tombstones. is_none( ) ) ;
575
575
// Immediate failure should have been propagated.
576
576
assert ! ( parent_inner. any_child_failed) ;
@@ -592,7 +592,7 @@ mod test {
592
592
// Otherwise, due to 'link', it would try to tombstone.
593
593
child2. reparent_children_to ( & mut parent) ;
594
594
// Should successfully unwrap even though 'link' is still alive.
595
- let mut parent_inner = unsafe { parent. unwrap ( ) } ;
595
+ let mut parent_inner = parent. unwrap ( ) ;
596
596
assert ! ( parent_inner. child_tombstones. is_none( ) ) ;
597
597
// Immediate failure should have been propagated by first child.
598
598
assert ! ( parent_inner. any_child_failed) ;
@@ -611,7 +611,7 @@ mod test {
611
611
// Let parent collect tombstones.
612
612
util:: ignore ( link) ;
613
613
// Must have created a tombstone
614
- let mut parent_inner = unsafe { parent. unwrap ( ) } ;
614
+ let mut parent_inner = parent. unwrap ( ) ;
615
615
assert ! ( parent_inner. child_tombstones. take_unwrap( ) ( ) ) ;
616
616
assert ! ( parent_inner. any_child_failed == false ) ;
617
617
}
@@ -630,7 +630,7 @@ mod test {
630
630
// Let parent collect tombstones.
631
631
util:: ignore ( link) ;
632
632
// Must have created a tombstone
633
- let mut parent_inner = unsafe { parent. unwrap ( ) } ;
633
+ let mut parent_inner = parent. unwrap ( ) ;
634
634
// Failure must be seen in the tombstone.
635
635
assert ! ( parent_inner. child_tombstones. take_unwrap( ) ( ) == false ) ;
636
636
assert ! ( parent_inner. any_child_failed == false ) ;
@@ -650,7 +650,7 @@ mod test {
650
650
// Let parent collect tombstones.
651
651
util:: ignore ( link) ;
652
652
// Must have created a tombstone
653
- let mut parent_inner = unsafe { parent. unwrap ( ) } ;
653
+ let mut parent_inner = parent. unwrap ( ) ;
654
654
assert ! ( parent_inner. child_tombstones. take_unwrap( ) ( ) ) ;
655
655
assert ! ( parent_inner. any_child_failed == false ) ;
656
656
}
@@ -671,7 +671,7 @@ mod test {
671
671
// Let parent collect tombstones.
672
672
util:: ignore ( link) ;
673
673
// Must have created a tombstone
674
- let mut parent_inner = unsafe { parent. unwrap ( ) } ;
674
+ let mut parent_inner = parent. unwrap ( ) ;
675
675
// Failure must be seen in the tombstone.
676
676
assert ! ( parent_inner. child_tombstones. take_unwrap( ) ( ) == false ) ;
677
677
assert ! ( parent_inner. any_child_failed == false ) ;
0 commit comments