From: Stefan Hajnoczi <stefanha@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, stefanha@redhat.com, qemu-rust@nongnu.org
Subject: Re: [PATCH] rust: restrict missing_const_for_fn to qemu_api crate
Date: Mon, 10 Feb 2025 09:06:12 -0500 [thread overview]
Message-ID: <CAJSP0QV+wfAFOeC_Jw5PBd5sOgzozPLPeEN=ddWd81Hok6uf4g@mail.gmail.com> (raw)
In-Reply-To: <20250207143952.2486587-2-pbonzini@redhat.com>
On Fri, Feb 7, 2025 at 9:40 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> missing_const_for_fn is not necessarily useful or good. For example in
> a private API you can always add const later, and in a public API
> it can be unnecessarily restrictive to annotate everything with const
> (blocking further improvements to the API).
>
> Nevertheless, QEMU turns it on because qemu_api uses const quite
> aggressively and therefore it can be handy to have as much as possible
> annotated with const. Outside qemu_api though, not so much: devices
> are self contained consumers and if there is nothing that could use
> their functions in const contexts that were not anticipated.
>
> Since missing_const_for_fn can be a bit noisy and trigger on trivial
> functions that no one would ever call in const context, do not
> turn it on everywhere and only keep it in qemu_api as a special case.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
prev parent reply other threads:[~2025-02-10 14:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-07 14:39 [PATCH] rust: restrict missing_const_for_fn to qemu_api crate Paolo Bonzini
2025-02-10 14:06 ` Stefan Hajnoczi [this message]
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='CAJSP0QV+wfAFOeC_Jw5PBd5sOgzozPLPeEN=ddWd81Hok6uf4g@mail.gmail.com' \
--to=stefanha@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-rust@nongnu.org \
--cc=stefanha@redhat.com \
/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).