On Fri, Oct 10, 2025 at 12:12 AM Paolo Bonzini <[email protected]> wrote:
>
> It is showing in the output of the bits! macro and not easy to fix there
> (at least not without making the macro more complex).  Disable it for
> now.
>
> Link: https://github.com/rust-lang/rust-clippy/issues/15852
> Reported-by: Richard Henderson <[email protected]>
> Signed-off-by: Paolo Bonzini <[email protected]>
> ---

How about putting it in the macro expansion instead of globally allowing it?

macro_rules! foo {
    ($a:expr, $b:expr, $c:expr, $d:expr) => {
        #[allow(clippy::double_parens)]
        InterruptMask(((($a.union($b).union($c).union($d))).into_bits()) as u32)
    }
}

Why is the double parenthesis needed here by the way? It's a method chain


>  rust/Cargo.toml | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/rust/Cargo.toml b/rust/Cargo.toml
> index 783e626802c..4f98b2c03d3 100644
> --- a/rust/Cargo.toml
> +++ b/rust/Cargo.toml
> @@ -109,6 +109,9 @@ used_underscore_binding = "deny"
>  # nice to have, but cannot be enabled yet
>  #wildcard_imports = "deny"   # still have many bindings::* imports
>
> +# https://github.com/rust-lang/rust-clippy/issues/15852
> +double_parens = "allow"
> +
>  # these may have false positives
>  #option_if_let_else = "deny"
>  cognitive_complexity = "deny"
> --
> 2.51.0
>
>

Reply via email to