From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PULL 01/16] rust: bindings: allow ptr_offset_with_cast
Date: Tue, 3 Jun 2025 23:45:08 +0200 [thread overview]
Message-ID: <20250603214523.131185-2-pbonzini@redhat.com> (raw)
In-Reply-To: <20250603214523.131185-1-pbonzini@redhat.com>
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>
---
rust/qemu-api/src/bindings.rs | 1 +
1 file changed, 1 insertion(+)
diff --git a/rust/qemu-api/src/bindings.rs b/rust/qemu-api/src/bindings.rs
index 3c1d297581e..057de4b6467 100644
--- a/rust/qemu-api/src/bindings.rs
+++ b/rust/qemu-api/src/bindings.rs
@@ -11,6 +11,7 @@
clippy::restriction,
clippy::style,
clippy::missing_const_for_fn,
+ clippy::ptr_offset_with_cast,
clippy::useless_transmute,
clippy::missing_safety_doc
)]
--
2.49.0
next prev parent reply other threads:[~2025-06-03 21:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-03 21:45 [PULL 00/16] rust, i386 changes for 2025-06-03 Paolo Bonzini
2025-06-03 21:45 ` Paolo Bonzini [this message]
2025-06-03 21:45 ` [PULL 02/16] meson: update to version 1.8.1 Paolo Bonzini
2025-06-03 21:45 ` [PULL 03/16] rust: use "objects" for Rust executables as well Paolo Bonzini
2025-06-03 21:45 ` [PULL 04/16] build, dockerfiles: add support for detecting rustdoc Paolo Bonzini
2025-06-03 21:45 ` [PULL 05/16] rust: add qemu-api doctests to "meson test" Paolo Bonzini
2025-06-03 21:45 ` [PULL 06/16] rust: cell: remove support for running doctests with "cargo test --doc" Paolo Bonzini
2025-06-03 21:45 ` [PULL 07/16] rust: use native Meson support for clippy and rustdoc Paolo Bonzini
2025-06-03 21:45 ` [PULL 08/16] target/i386: Remove FRED dependency on WRMSRNS Paolo Bonzini
2025-06-03 21:45 ` [PULL 09/16] target/i386: Add a new CPU feature word for CPUID.7.1.ECX Paolo Bonzini
2025-06-03 21:45 ` [PULL 10/16] target/i386: Add the immediate form MSR access instruction support Paolo Bonzini
2025-06-03 21:45 ` [PULL 11/16] meson: use config_base_arch for target libraries Paolo Bonzini
2025-06-03 21:45 ` [PULL 12/16] i386/tdx: Fix build on 32-bit host Paolo Bonzini
2025-06-03 21:45 ` [PULL 13/16] i386/tdvf: " Paolo Bonzini
2025-06-03 21:45 ` [PULL 14/16] rust: add "bits", a custom bitflags implementation Paolo Bonzini
2025-06-03 21:45 ` [PULL 15/16] rust: pl011: use the bits macro Paolo Bonzini
2025-06-03 21:45 ` [PULL 16/16] rust: qemu-api-macros: add from_bits and into_bits to #[derive(TryInto)] Paolo Bonzini
2025-06-05 14:56 ` [PULL 00/16] rust, i386 changes for 2025-06-03 Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250603214523.131185-2-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).