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
Hi, thanks for making this! I'm getting these compiler errors and am unsure how to fix them. I'm just running cargo build in the root of the directory.
Compiling ffi_helpers v0.2.1-alpha.0 (/Users/4meta5/ffi_helpers)
error[E0080]: it is undefined behavior to use this value
--> src/nullable.rs:29:5
|
29 | const NULL: Self = std::ptr::null();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized raw pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error[E0080]: it is undefined behavior to use this value
--> src/nullable.rs:36:5
|
36 | const NULL: Self = std::ptr::null_mut();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized raw pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
error: could not compile `ffi_helpers`.
To learn more, run the command again with --verbose.
I found this while trying to compile a repo that uses an older version as a dependency and getting a similar error sunshine-protocol/sunscreen#1
The text was updated successfully, but these errors were encountered:
I have a feeling this is due to recent work towards const evaluation, where they've added new type validity checks which fail for our use of NULL on raw pointer types.
Switching the Nullable::is_null() implementation from *self == Self::NULL to <*const T>::is_null(*self) makes the error go away, but I'm not sure whether that's because it's okay or the type validation didn't pick it up. I've created rust-lang/rust#71353, so let's wait to see what they say.
I don't believe there's a soundness problem here. We never dereference Self::NULL, so at no point does uninitialized memory get access.
Hi, thanks for making this! I'm getting these compiler errors and am unsure how to fix them. I'm just running
cargo build
in the root of the directory.I found this while trying to compile a repo that uses an older version as a dependency and getting a similar error sunshine-protocol/sunscreen#1
The text was updated successfully, but these errors were encountered: