From 0a940d7e7d6923c11779926384be2f779e6c5efb Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 22 Feb 2024 22:53:27 +0900 Subject: [PATCH] Ignore buggy clippy::incompatible_msrv lint This lint doesn't consider cfg. ``` error: current MSRV (Minimum Supported Rust Version) is `1.34.0` but this item is stable since `1.45.0` --> src\imp\core_atomic.rs:314:32 | 314 | self.inner.fetch_max(val, order) | ^^^^^^^^^^^^^^^^^^^^^ ... 415 | atomic_int!(AtomicIsize, isize); | ------------------------------- in this macro invocation | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv = note: `-D clippy::incompatible-msrv` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::incompatible_msrv)]` = note: this error originates in the macro `atomic_int` (in Nightly builds, run with -Z macro-backtrace for more info) ``` --- .github/workflows/ci.yml | 1 + bench/benches/bench.rs | 1 + portable-atomic-util/src/lib.rs | 3 +++ src/lib.rs | 1 + tests/helper/src/lib.rs | 1 + 5 files changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44943207..187c80f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,6 +112,7 @@ jobs: flags: -Z codegen-backend=cranelift - rust: nightly-2024-02-05 # TODO: core_simd bug https://github.com/rust-lang/portable-simd/pull/396 target: aarch64_be-unknown-linux-gnu + flags: -A unknown_lints # TODO: buggy clippy::incompatible_msrv lint is not available on nightly-2024-02-05, so unknown_lints also need to be allowed. - rust: stable target: aarch64-unknown-linux-musl - rust: stable diff --git a/bench/benches/bench.rs b/bench/benches/bench.rs index abb1f1be..6644f04f 100644 --- a/bench/benches/bench.rs +++ b/bench/benches/bench.rs @@ -5,6 +5,7 @@ internal_features, unused_extern_crates, clippy::duplicate_mod, + clippy::incompatible_msrv, // https://github.com/rust-lang/rust-clippy/issues/12257 clippy::inline_always, clippy::naive_bytecount, clippy::only_used_in_recursion, diff --git a/portable-atomic-util/src/lib.rs b/portable-atomic-util/src/lib.rs index ca1f2529..bb6bc568 100644 --- a/portable-atomic-util/src/lib.rs +++ b/portable-atomic-util/src/lib.rs @@ -58,6 +58,9 @@ See [#1] for other primitives being considered for addition to this crate. clippy::std_instead_of_alloc, clippy::std_instead_of_core, )] +#![allow( + clippy::incompatible_msrv, // false positive: this lint doesn't consider cfg +)] // docs.rs only #![cfg_attr(portable_atomic_doc_cfg, feature(doc_cfg))] diff --git a/src/lib.rs b/src/lib.rs index 565513e7..d3316d41 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -211,6 +211,7 @@ RUSTFLAGS="--cfg portable_atomic_no_outline_atomics" cargo ... #![cfg_attr(not(portable_atomic_no_asm), warn(missing_docs))] // module-level #![allow(missing_docs)] doesn't work for macros on old rustc #![allow( clippy::cast_lossless, + clippy::incompatible_msrv, // false positive: this lint doesn't consider cfg clippy::inline_always, clippy::naive_bytecount, clippy::unreadable_literal diff --git a/tests/helper/src/lib.rs b/tests/helper/src/lib.rs index da07a4c7..0b03cc87 100644 --- a/tests/helper/src/lib.rs +++ b/tests/helper/src/lib.rs @@ -3,6 +3,7 @@ #![no_std] #![allow( missing_debug_implementations, + clippy::incompatible_msrv, clippy::missing_panics_doc, clippy::thread_local_initializer_can_be_made_const, // clippy bug: this lint doesn't consider MSRV clippy::undocumented_unsafe_blocks