Skip to content

Commit 47dc5fe

Browse files
committed
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.
1 parent b7c2f88 commit 47dc5fe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sched.rs

Lines changed: 4 additions & 1 deletion
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)