-
Notifications
You must be signed in to change notification settings - Fork 13.3k
llvm: Stored value type does not match pointer operand type! #30494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This seems unrelated to #19571. I could try to reduce rust.js myself, it looks like a moderately sized project. |
Thanks @eddyb for that so detailed reply, do you think it's related to this commit yorkie/rust.js@9525af0? |
No, not really. #[repr(C)]
pub struct FunctionCallbackInfo(*mut *mut FunctionCallbackInfo);
...
impl StringBytes {
extern fn New(arguments: v8::FunctionCallbackInfo) {
arguments.GetReturnValue().SetWithBool(true);
}
} One way you might be able to work around this bug would be to remove one level of indirection, e.g. extern {
fn v8_function_callback_info_get_return_value(this: &mut FunctionCallbackInfo) -> &mut ReturnValue;
}
// Doesn't really matter what's inside, can still pretend there's a pointer there.
#[repr(C)]
pub struct FunctionCallbackInfo(*mut u8);
#[repr(C)]
pub struct ReturnValue(*mut u8);
impl FunctionCallbackInfo {
pub fn GetReturnValue(&mut self) -> &mut ReturnValue {
unsafe { v8_function_callback_info_get_return_value(self) }
}
}
impl StringBytes {
extern fn New(arguments: &mut v8::FunctionCallbackInfo) {
arguments.GetReturnValue().SetWithBool(true);
}
} And on the C++ side: ReturnValue<Value> v8_function_callback_info_get_return_value(FunctionCallbackInfo<Value> *callbackInfo) {
return callbackInfo->GetReturnValue();
} It would be a pretty big change, but it should make your code compile. |
duplicate of #30235. |
Hey Rust Team,
I got this error at compiling time:
With my personal rust module: https://github.com/yorkie/rust.js, I found the same issue at #19571.
I used the latest 1.5.0, however it worked at 1.0.0.
The text was updated successfully, but these errors were encountered: