From 153217b9816aaba801184f19865226abd41d1a74 Mon Sep 17 00:00:00 2001 From: John-John Tedro Date: Fri, 24 May 2024 16:05:54 +0200 Subject: [PATCH] Update lints to use soon to be stable config --- .github/workflows/ci.yml | 2 +- crates/rune-alloc/Cargo.toml | 3 ++ crates/rune-alloc/src/hashbrown/raw/mod.rs | 44 ---------------------- crates/rune-alloc/src/lib.rs | 1 - crates/rune-core/Cargo.toml | 3 ++ crates/rune-core/src/lib.rs | 1 - crates/rune/Cargo.toml | 3 ++ crates/rune/src/lib.rs | 1 - 8 files changed, 10 insertions(+), 48 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad837b69d..5a180b023 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,7 +88,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - run: cargo miri test -p rune-alloc --all-features - rune_nightly: + nightly: runs-on: ubuntu-latest needs: basics env: diff --git a/crates/rune-alloc/Cargo.toml b/crates/rune-alloc/Cargo.toml index 2795d21c6..fd619bba4 100644 --- a/crates/rune-alloc/Cargo.toml +++ b/crates/rune-alloc/Cargo.toml @@ -13,6 +13,9 @@ license = "MIT OR Apache-2.0" keywords = ["language", "scripting", "scripting-language"] categories = ["parser-implementations"] +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(rune_nightly)'] } + [features] default = ["std", "serde"] std = ["alloc", "ahash/std", "serde?/std"] diff --git a/crates/rune-alloc/src/hashbrown/raw/mod.rs b/crates/rune-alloc/src/hashbrown/raw/mod.rs index 97ad670fa..02c5556df 100644 --- a/crates/rune-alloc/src/hashbrown/raw/mod.rs +++ b/crates/rune-alloc/src/hashbrown/raw/mod.rs @@ -3360,50 +3360,6 @@ impl RawIterRange { } } - /// Splits a `RawIterRange` into two halves. - /// - /// Returns `None` if the remaining range is smaller than or equal to the - /// group width. - #[cfg_attr(feature = "inline-more", inline)] - #[cfg(feature = "rayon")] - pub(crate) fn split(mut self) -> (Self, Option>) { - unsafe { - if self.end <= self.next_ctrl { - // Nothing to split if the group that we are current processing - // is the last one. - (self, None) - } else { - // len is the remaining number of elements after the group that - // we are currently processing. It must be a multiple of the - // group size (small tables are caught by the check above). - let len = offset_from(self.end, self.next_ctrl); - debug_assert_eq!(len % Group::WIDTH, 0); - - // Split the remaining elements into two halves, but round the - // midpoint down in case there is an odd number of groups - // remaining. This ensures that: - // - The tail is at least 1 group long. - // - The split is roughly even considering we still have the - // current group to process. - let mid = (len / 2) & !(Group::WIDTH - 1); - - let tail = Self::new( - self.next_ctrl.add(mid), - self.data.next_n(Group::WIDTH).next_n(mid), - len - mid, - ); - debug_assert_eq!( - self.data.next_n(Group::WIDTH).next_n(mid).ptr, - tail.data.ptr - ); - debug_assert_eq!(self.end, tail.end); - self.end = self.next_ctrl.add(mid); - debug_assert_eq!(self.end.add(Group::WIDTH), tail.next_ctrl); - (self, Some(tail)) - } - } - } - /// # Safety /// If DO_CHECK_PTR_RANGE is false, caller must ensure that we never try to iterate /// after yielding all elements. diff --git a/crates/rune-alloc/src/lib.rs b/crates/rune-alloc/src/lib.rs index 61acb5d37..3084c75f3 100644 --- a/crates/rune-alloc/src/lib.rs +++ b/crates/rune-alloc/src/lib.rs @@ -34,7 +34,6 @@ // may not be copied, modified, or distributed except according to those terms. #![no_std] -#![allow(unexpected_cfgs)] #![deny(rustdoc::broken_intra_doc_links)] #![deny(rustdoc::private_doc_tests)] #![cfg_attr(rune_nightly, deny(rustdoc::missing_doc_code_examples))] diff --git a/crates/rune-core/Cargo.toml b/crates/rune-core/Cargo.toml index 0a2b0190d..e6250e84f 100644 --- a/crates/rune-core/Cargo.toml +++ b/crates/rune-core/Cargo.toml @@ -13,6 +13,9 @@ license = "MIT OR Apache-2.0" keywords = ["language", "scripting", "scripting-language"] categories = ["parser-implementations"] +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(rune_nightly)'] } + [features] default = ["alloc"] doc = [] diff --git a/crates/rune-core/src/lib.rs b/crates/rune-core/src/lib.rs index e25efb672..d56e3dd93 100644 --- a/crates/rune-core/src/lib.rs +++ b/crates/rune-core/src/lib.rs @@ -23,7 +23,6 @@ //! **YOU ARE NOT** supposed to depend on this directly. Doing so might cause //! dependency errors since its API is not stable. -#![allow(unexpected_cfgs)] #![allow(clippy::module_inception)] #![deny(rustdoc::broken_intra_doc_links)] #![deny(rustdoc::private_doc_tests)] diff --git a/crates/rune/Cargo.toml b/crates/rune/Cargo.toml index 95b343cb2..6e9524c9c 100644 --- a/crates/rune/Cargo.toml +++ b/crates/rune/Cargo.toml @@ -13,6 +13,9 @@ license = "MIT OR Apache-2.0" keywords = ["language", "scripting", "scripting-language"] categories = ["parser-implementations"] +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(rune_nightly, rune_docsrs, rune_byte_code)'] } + [features] default = ["emit", "std"] emit = ["std", "codespan-reporting"] diff --git a/crates/rune/src/lib.rs b/crates/rune/src/lib.rs index 14825da95..0ea5379f1 100644 --- a/crates/rune/src/lib.rs +++ b/crates/rune/src/lib.rs @@ -133,7 +133,6 @@ #![deny(rustdoc::private_doc_tests)] #![cfg_attr(rune_nightly, feature(rustdoc_missing_doc_code_examples))] #![cfg_attr(rune_nightly, deny(rustdoc::missing_doc_code_examples))] -#![allow(unexpected_cfgs)] #![allow(clippy::enum_variant_names)] #![allow(clippy::needless_doctest_main)] #![allow(clippy::too_many_arguments)]