qemu/rust
Paolo Bonzini b652d51285 rust: bindings: allow ptr_offset_with_cast
This is produced by recent versions of bindgen:

warning: use of `offset` with a `usize` casted to an `isize`
  --> /builds/bonzini/qemu/rust/target/debug/build/qemu_api-35cb647f4db404b8/out/bindings.inc.rs:39:21
   |
39 |         let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize);
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(core::ptr::addr_of!((*this).storage) as *const u8).add(byte_index)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast
   = note: `#[warn(clippy::ptr_offset_with_cast)]` on by default
warning: use of `offset` with a `usize` casted to an `isize`
  --> /builds/bonzini/qemu/rust/target/debug/build/qemu_api-35cb647f4db404b8/out/bindings.inc.rs:68:13
   |
68 |             (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(core::ptr::addr_of_mut!((*this).storage) as *mut u8).add(byte_index)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast

This seems to be new in bindgen 0.71.0, possibly related to bindgen
commit 33006185b7878 ("Add raw_ref_macros feature", 2024-11-22).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-03 22:42:18 +02:00
..
hw rust: make declaration of dependent crates more consistent 2025-05-28 19:35:55 +02:00
qemu-api rust: bindings: allow ptr_offset_with_cast 2025-06-03 22:42:18 +02:00
qemu-api-macros rust: make declaration of dependent crates more consistent 2025-05-28 19:35:55 +02:00
.gitignore rust: add bindgen step as a meson dependency 2024-10-11 12:32:17 +02:00
Cargo.lock rust: remove offset_of replacement 2025-05-06 16:02:04 +02:00
Cargo.toml rust: clippy: enable uninlined_format_args lint 2025-05-06 16:02:04 +02:00
clippy.toml rust: clippy: enable uninlined_format_args lint 2025-05-06 16:02:04 +02:00
Kconfig rust: add PL011 device model 2024-11-05 14:18:15 +01:00
meson.build rust: make declaration of dependent crates more consistent 2025-05-28 19:35:55 +02:00
rustfmt.toml rust: add crate to expose bindings and interfaces 2024-10-11 12:32:17 +02:00
wrapper.h include/system: Move exec/address-spaces.h to system/address-spaces.h 2025-04-23 14:08:21 -07:00