File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 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> {
17391739impl < ' scope , T > JoinInner < ' scope , T > {
17401740 fn join ( mut self ) -> Result < T > {
17411741 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 ( )
17471752 }
17481753}
17491754
You can’t perform that action at this time.
0 commit comments