* [PATCH] rust: pl011: use default set of lints
@ 2025-02-07 14:39 Paolo Bonzini
2025-02-10 14:03 ` Stefan Hajnoczi
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2025-02-07 14:39 UTC (permalink / raw)
To: qemu-devel; +Cc: stefanha, qemu-rust
Being the first crate added to QEMU, pl011 has a rather restrictive
Clippy setup. This can be sometimes a bit too heavy on its suggestions,
for example
error: this could be a `const fn`
--> hw/char/pl011/src/device.rs:382:5
|
382 | / fn set_read_trigger(&mut self) {
383 | | self.read_trigger = 1;
384 | | }
| |_____^
Just use the standard set that is present in rust/Cargo.toml, with
just a small adjustment to allow upper case acronyms which are used
for register names.
Reported-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
rust/hw/char/pl011/src/lib.rs | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/rust/hw/char/pl011/src/lib.rs b/rust/hw/char/pl011/src/lib.rs
index 88452dc888c..1bf46c65af2 100644
--- a/rust/hw/char/pl011/src/lib.rs
+++ b/rust/hw/char/pl011/src/lib.rs
@@ -12,16 +12,7 @@
//! See [`PL011State`](crate::device::PL011State) for the device model type and
//! the [`registers`] module for register types.
-#![deny(
- clippy::correctness,
- clippy::suspicious,
- clippy::complexity,
- clippy::perf,
- clippy::nursery,
- clippy::style
-)]
#![allow(clippy::upper_case_acronyms)]
-#![allow(clippy::result_unit_err)]
use qemu_api::c_str;
--
2.48.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rust: pl011: use default set of lints
2025-02-07 14:39 [PATCH] rust: pl011: use default set of lints Paolo Bonzini
@ 2025-02-10 14:03 ` Stefan Hajnoczi
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2025-02-10 14:03 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, stefanha, qemu-rust
On Fri, Feb 7, 2025 at 9:40 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Being the first crate added to QEMU, pl011 has a rather restrictive
> Clippy setup. This can be sometimes a bit too heavy on its suggestions,
> for example
>
> error: this could be a `const fn`
> --> hw/char/pl011/src/device.rs:382:5
> |
> 382 | / fn set_read_trigger(&mut self) {
> 383 | | self.read_trigger = 1;
> 384 | | }
> | |_____^
>
> Just use the standard set that is present in rust/Cargo.toml, with
> just a small adjustment to allow upper case acronyms which are used
> for register names.
>
> Reported-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> rust/hw/char/pl011/src/lib.rs | 9 ---------
> 1 file changed, 9 deletions(-)
(I'm late, don't worry if my R-b gets lost.)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
>
> diff --git a/rust/hw/char/pl011/src/lib.rs b/rust/hw/char/pl011/src/lib.rs
> index 88452dc888c..1bf46c65af2 100644
> --- a/rust/hw/char/pl011/src/lib.rs
> +++ b/rust/hw/char/pl011/src/lib.rs
> @@ -12,16 +12,7 @@
> //! See [`PL011State`](crate::device::PL011State) for the device model type and
> //! the [`registers`] module for register types.
>
> -#![deny(
> - clippy::correctness,
> - clippy::suspicious,
> - clippy::complexity,
> - clippy::perf,
> - clippy::nursery,
> - clippy::style
> -)]
> #![allow(clippy::upper_case_acronyms)]
> -#![allow(clippy::result_unit_err)]
>
> use qemu_api::c_str;
>
> --
> 2.48.1
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-10 14:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-07 14:39 [PATCH] rust: pl011: use default set of lints Paolo Bonzini
2025-02-10 14:03 ` Stefan Hajnoczi
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).