File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -1739,11 +1739,16 @@ struct JoinInner<'scope, T> {
1739
1739
impl < ' scope , T > JoinInner < ' scope , T > {
1740
1740
fn join ( mut self ) -> Result < T > {
1741
1741
self . native . join ( ) ;
1742
- if let Some ( packet) = Arc :: get_mut ( & mut self . packet ) {
1743
- packet. result . get_mut ( ) . take ( ) . unwrap ( )
1744
- } else {
1745
- Err ( Box :: new ( "thread terminated unexpectedly" ) )
1746
- }
1742
+ Arc :: get_mut ( & mut self . packet )
1743
+ // FIXME(fuzzypixelz): returning an error instead of panicking here
1744
+ // would require updating the documentation of
1745
+ // `std::thread::Result`; currently we can return `Err` if and only
1746
+ // if the thread had panicked.
1747
+ . expect ( "threads should not terminate unexpectedly" )
1748
+ . result
1749
+ . get_mut ( )
1750
+ . take ( )
1751
+ . unwrap ( )
1747
1752
}
1748
1753
}
1749
1754
You can’t perform that action at this time.
0 commit comments