(closure: F)
| 89 | } |
| 90 | |
| 91 | fn context_and_function<F>(closure: F) -> (*mut c_void, dispatch_function_t) |
| 92 | where F: FnOnce() { |
| 93 | extern fn work_execute_closure<F>(context: Box<F>) where F: FnOnce() { |
| 94 | (*context)(); |
| 95 | } |
| 96 | |
| 97 | let closure = Box::new(closure); |
| 98 | let func: extern fn(Box<F>) = work_execute_closure::<F>; |
| 99 | unsafe { |
| 100 | (mem::transmute(closure), mem::transmute(func)) |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | fn context_and_sync_function<F>(closure: &mut Option<F>) -> |
| 105 | (*mut c_void, dispatch_function_t) |
no outgoing calls
no test coverage detected