qemu-rust.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	 Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	qemu-rust@nongnu.org
Subject: Re: [PATCH v2] rust: bindings: allow any number of params
Date: Tue, 15 Jul 2025 08:44:35 +0200	[thread overview]
Message-ID: <CABgObfZE1bZkKqJgEHWLsnwcQ1Zfy2JLNKqudZEGQdA+Nc8TrA@mail.gmail.com> (raw)
In-Reply-To: <e41344bd22248b0883752ef7a7c459090a3d9cfc.1752560127.git.mst@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1943 bytes --]

Il mar 15 lug 2025, 08:20 Michael S. Tsirkin <mst@redhat.com> ha scritto:

> We are going to be adding more parameters, and this makes
> rust unhappy:
>     Functions with lots of parameters are considered bad style and reduce
>     readability (“what does the 5th parameter mean?”). Consider grouping
>     some parameters into a new type.
>
> Specifically:
>
> error: this function has too many arguments (8/7)
>     -->
> /builds/mstredhat/qemu/build/rust/qemu-api/rust-qemu-api-tests.p/structured/bindings.inc.rs:3840
> :5
>

Acked-by: Paolo Bonzini <pbonzini@redhat.com>


     |
> 3840 | /     pub fn new_bitfield_1(
> 3841 | |         secure: std::os::raw::c_uint,
> 3842 | |         space: std::os::raw::c_uint,
> 3843 | |         user: std::os::raw::c_uint,
> ...    |
> 3848 | |         address_type: std::os::raw::c_uint,
> 3849 | |     ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
>      | |____________________________________________^
>      |
>      = help: for further information visit
> https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
>      = note: `-D clippy::too-many-arguments` implied by `-D warnings`
>      = help: to override `-D warnings` add
> `#[allow(clippy::too_many_arguments)]`
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  rust/qemu-api/src/bindings.rs | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/rust/qemu-api/src/bindings.rs b/rust/qemu-api/src/bindings.rs
> index 057de4b646..c4f1f755ce 100644
> --- a/rust/qemu-api/src/bindings.rs
> +++ b/rust/qemu-api/src/bindings.rs
> @@ -13,7 +13,8 @@
>      clippy::missing_const_for_fn,
>      clippy::ptr_offset_with_cast,
>      clippy::useless_transmute,
> -    clippy::missing_safety_doc
> +    clippy::missing_safety_doc,
> +    clippy::too_many_arguments
>  )]
>
>  //! `bindgen`-generated declarations.
> --
> MST
>
>
>

[-- Attachment #2: Type: text/html, Size: 3368 bytes --]

  parent reply	other threads:[~2025-07-15  6:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-15  6:15 [PATCH v2] rust: bindings: allow any number of params Michael S. Tsirkin
2025-07-15  6:22 ` Philippe Mathieu-Daudé
2025-07-15  6:44 ` Paolo Bonzini [this message]
2025-07-15  7:23 ` Manos Pitsidianakis

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=CABgObfZE1bZkKqJgEHWLsnwcQ1Zfy2JLNKqudZEGQdA+Nc8TrA@mail.gmail.com \
    --to=pbonzini@redhat.com \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-rust@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).