Skip to content

Commit

Permalink
Cast function item to function pointer in order to appease compiler.
Browse files Browse the repository at this point in the history
This is necessary because of compiler changes. For further information
look at rust-lang/rust#19925.
  • Loading branch information
fiveop committed Apr 14, 2016
1 parent b7c2f88 commit 47dc5fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ pub fn clone(mut cb: CloneCb, stack: &mut [u8], flags: CloneFlags) -> Result<pid

let res = unsafe {
let ptr = stack.as_mut_ptr().offset(stack.len() as isize);
ffi::clone(mem::transmute(callback), ptr as *mut c_void, flags.bits(), &mut cb)
ffi::clone(mem::transmute(callback as extern "C" fn(*mut Box<::std::ops::FnMut() -> isize>) -> i32),
ptr as *mut c_void,
flags.bits(),
&mut cb)
};

Errno::result(res)
Expand Down

0 comments on commit 47dc5fe

Please sign in to comment.