Skip to content

Commit 9d912ae

Browse files
committed
Auto merge of #353 - fiveop:nightly_warning, r=kamalmarhubi
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.
2 parents ec37fa8 + 47dc5fe commit 9d912ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sched.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@ pub fn clone(mut cb: CloneCb, stack: &mut [u8], flags: CloneFlags) -> Result<pid
205205

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

211214
Errno::result(res)

0 commit comments

Comments
 (0)