You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The field function_pointer in struct GuestFunctionDefinition is defined as a i64.
This requires that a function pointer passed to register_function is cast to i64
When running clippy on a guest that casts from a func directly to i64 (e.g. myfunc as i64) results in the clippy error "casting function pointer myfunc to i64" and the suggested fix "try: myfunc as usize" which does not work.
The options are to disable the clippy check ([allow(clippy::fn_to_numeric_cast)]) or to double cast the pointer (e.g. myfunc as *const() as i64 or myfunc as usize as i64).
Should the definition of the field function pointer be changed to either usize or fn(&FunctionCall) -> Result<Vec<u8>>
The text was updated successfully, but these errors were encountered:
The field
function_pointer
in structGuestFunctionDefinition
is defined as a i64.This requires that a function pointer passed to
register_function
is cast to i64When running clippy on a guest that casts from a func directly to i64 (e.g.
myfunc as i64
) results in the clippy error "casting function pointermyfunc
toi64
" and the suggested fix "try:myfunc as usize
" which does not work.The options are to disable the clippy check (
[allow(clippy::fn_to_numeric_cast)]
) or to double cast the pointer (e.g.myfunc as *const() as i64
ormyfunc as usize as i64
).Should the definition of the field function pointer be changed to either
usize
orfn(&FunctionCall) -> Result<Vec<u8>>
The text was updated successfully, but these errors were encountered: