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 unsafe_op_in_unsafe_fn lint now warns by default. This warning detects calls to unsafe operations in unsafe functions without an explicit unsafe block.
warning[E0133]: dereference of raw pointer is unsafe and requires unsafe block
--> /origin/home/jmjoy/workspace/rust/phper/target/debug/build/phper-sys-ef5a7a32f49c54c5/out/php_bindings.rs:39:20
|
39 | let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
= note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
note: an unsafe function restricts its caller, but its body is safe by default
--> /origin/home/jmjoy/workspace/rust/phper/target/debug/build/phper-sys-ef5a7a32f49c54c5/out/php_bindings.rs:36:5
|
36 | pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `#[warn(unsafe_op_in_unsafe_fn)]` on by default
The text was updated successfully, but these errors were encountered:
Unsafe bitfield raw getters and setters (line 39 in your case) are addressed in #3124. For other cases, bindgen's --wrap-unsafe-ops option should do the work.
Maybe it makes sense to enable wrap_unsafe_ops by default?
Looks like it was first implemented by #2266 but then it broke building for Rust <1.65, so it was re-implemented as an optional flag.
Maybe it makes sense to enable wrap_unsafe_ops by default? Looks like it was first implemented by #2266 but then it broke building for Rust <1.65, so it was re-implemented as an optional flag.
Yeah it makes sense to at least enable wrap_unsafe_ops when the target edition is set to 2024.
The unsafe_op_in_unsafe_fn lint now warns by default. This warning detects calls to unsafe operations in unsafe functions without an explicit unsafe block.
The text was updated successfully, but these errors were encountered: