diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2025-02-07 15:38:40 +0100 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-02-10 11:18:32 +0100 |
| commit | 476d6e4c9c4965734d6f47ee299ac9f84440a9b3 (patch) | |
| tree | 6791dbba7248157b9f6f4f53cef492c1f2b5cde2 /rust/qemu-api/src/lib.rs | |
| parent | 9955093b302b318cd2c8a34dc96913531abd3df9 (diff) | |
| download | focaccia-qemu-476d6e4c9c4965734d6f47ee299ac9f84440a9b3.tar.gz focaccia-qemu-476d6e4c9c4965734d6f47ee299ac9f84440a9b3.zip | |
rust: restrict missing_const_for_fn to qemu_api crate
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>
Diffstat (limited to 'rust/qemu-api/src/lib.rs')
| -rw-r--r-- | rust/qemu-api/src/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/rust/qemu-api/src/lib.rs b/rust/qemu-api/src/lib.rs index 83c6a987c0..3cf9371cff 100644 --- a/rust/qemu-api/src/lib.rs +++ b/rust/qemu-api/src/lib.rs @@ -3,6 +3,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #![cfg_attr(not(MESON), doc = include_str!("../README.md"))] +#![deny(clippy::missing_const_for_fn)] #[rustfmt::skip] pub mod bindings; |