File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -511,15 +511,8 @@ fn spawn_raw(+opts: TaskOpts, +f: fn~()) {
511
511
512
512
let child_wrapper = make_child_wrapper ( new_task, move child_tg,
513
513
move ancestors, is_main, move notify_chan, move f) ;
514
- /*
515
- Truly awful, but otherwise the borrow checker complains about
516
- the move in the last line of this block, for reasons I can't
517
- understand. -- tjc
518
- */
519
- let tmp: u64 = cast:: reinterpret_cast ( & ( & child_wrapper) ) ;
520
- let whatever: & ~fn ( ) = cast:: reinterpret_cast ( & tmp) ;
521
- let fptr = ptr:: p2:: addr_of ( whatever) ;
522
- let closure: * rust_closure = cast:: reinterpret_cast ( & fptr) ;
514
+
515
+ let closure = cast:: transmute ( & child_wrapper) ;
523
516
524
517
// Getting killed between these two calls would free the child's
525
518
// closure. (Reordering them wouldn't help - then getting killed
You can’t perform that action at this time.
0 commit comments