Skip to content

Commit

Permalink
Auto merge of #353 - fiveop:nightly_warning, r=kamalmarhubi
Browse files Browse the repository at this point in the history
Cast function item to function pointer in order to appease compiler.

This is necessary because of compiler changes. For further information
look at rust-lang/rust#19925.

This solves #346.

I know that there are other problems with the affected function. We are thinking about how to best pass the arguments to the function and we don't want to define the ffi's ourselves. However, I would like to get the warning out of our tree as soon as possible. We do not need to wait for our polish.
  • Loading branch information
homu committed Apr 18, 2016
2 parents ec37fa8 + 47dc5fe commit 9d912ae
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 9d912ae

Please sign in to comment.