From a5381f13dcfb5fc249709ef47bff0a5e88d325b3 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 15 Sep 2024 15:52:38 +0900 Subject: [PATCH 1/3] Fix unexpected_cfgs warning ``` error: unexpected `cfg` condition name: `slab_no_const_vec_new` --> src/lib.rs:252:15 | 252 | #[cfg(not(slab_no_const_vec_new))] | ^^^^^^^^^^^^^^^^^^^^^ | = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows` = help: consider using a Cargo feature instead = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint: [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(slab_no_const_vec_new)'] } = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(slab_no_const_vec_new)");` to the top of the `build.rs` = note: see for more information about checking conditional configuration = note: `-D unexpected-cfgs` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unexpected_cfgs)]` error: unexpected `cfg` condition name: `slab_no_const_vec_new` --> src/lib.rs:266:11 | 266 | #[cfg(slab_no_const_vec_new)] | ^^^^^^^^^^^^^^^^^^^^^ | = help: consider using a Cargo feature instead = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint: [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(slab_no_const_vec_new)'] } = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(slab_no_const_vec_new)");` to the top of the `build.rs` = note: see for more information about checking conditional configuration error: unexpected `cfg` condition name: `slab_no_track_caller` --> src/lib.rs:931:20 | 931 | #[cfg_attr(not(slab_no_track_caller), track_caller)] | ^^^^^^^^^^^^^^^^^^^^ | = help: consider using a Cargo feature instead = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint: [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(slab_no_track_caller)'] } = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(slab_no_track_caller)");` to the top of the `build.rs` = note: see for more information about checking conditional configuration error: unexpected `cfg` condition name: `slab_no_track_caller` --> src/lib.rs:1100:20 | 1100 | #[cfg_attr(not(slab_no_track_caller), track_caller)] | ^^^^^^^^^^^^^^^^^^^^ | = help: consider using a Cargo feature instead = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint: [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(slab_no_track_caller)'] } = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(slab_no_track_caller)");` to the top of the `build.rs` = note: see for more information about checking conditional configuration error: unexpected `cfg` condition name: `slab_no_track_caller` --> src/lib.rs:1208:20 | 1208 | #[cfg_attr(not(slab_no_track_caller), track_caller)] | ^^^^^^^^^^^^^^^^^^^^ | = help: consider using a Cargo feature instead = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint: [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(slab_no_track_caller)'] } = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(slab_no_track_caller)");` to the top of the `build.rs` = note: see for more information about checking conditional configuration error: unexpected `cfg` condition name: `slab_no_track_caller` --> src/lib.rs:1218:20 | 1218 | #[cfg_attr(not(slab_no_track_caller), track_caller)] | ^^^^^^^^^^^^^^^^^^^^ | = help: consider using a Cargo feature instead = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint: [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(slab_no_track_caller)'] } = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(slab_no_track_caller)");` to the top of the `build.rs` = note: see for more information about checking conditional configuration ``` --- build.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.rs b/build.rs index b60351a..12a5212 100644 --- a/build.rs +++ b/build.rs @@ -1,4 +1,7 @@ fn main() { + println!("cargo:rerun-if-changed=build.rs"); + println!("cargo:rustc-check-cfg=cfg(slab_no_const_vec_new,slab_no_track_caller)"); + let cfg = match autocfg::AutoCfg::new() { Ok(cfg) => cfg, Err(e) => { From fb977adf77e0573446da4ee1d062e34a2ffe39e6 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 15 Sep 2024 15:55:42 +0900 Subject: [PATCH 2/3] Ignore buggy clippy::incompatible_msrv lint ``` error: current MSRV (Minimum Supported Rust Version) is `1.31.0` but this item is stable since `1.37.0` --> src/lib.rs:885:32 | 885 | let ptr = self.entries.as_mut_ptr(); | ^^^^^^^^^^^^ | = 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)]` error: current MSRV (Minimum Supported Rust Version) is `1.31.0` but this item is stable since `1.37.0` --> src/lib.rs:934:37 | 934 | let base_ptr = self.entries.as_ptr() as usize; | ^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv ``` --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index 8abec35..8317c5f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,6 +9,7 @@ no_crate_inject, attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables)) ))] +#![allow(clippy::incompatible_msrv)] // false positive: https://github.com/rust-lang/rust-clippy/issues/12280 //! Pre-allocated storage for a uniform data type. //! From 880172bd6aee007d25d9a08dcc3c8cb0e7da1b24 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 15 Sep 2024 15:57:27 +0900 Subject: [PATCH 3/3] Automatically cancel all outdated workflows on PR --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b30b89..f68f312 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,10 @@ env: RUSTFLAGS: -Dwarnings RUST_BACKTRACE: 1 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + jobs: test: runs-on: ubuntu-latest