diff --git a/necsim/core/bond/src/closed_open_unit_f64.rs b/necsim/core/bond/src/closed_open_unit_f64.rs index e6424106a..1f37589d1 100644 --- a/necsim/core/bond/src/closed_open_unit_f64.rs +++ b/necsim/core/bond/src/closed_open_unit_f64.rs @@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize}; use crate::ClosedUnitF64; #[derive(Debug)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct ClosedOpenUnitF64Error(f64); impl fmt::Display for ClosedOpenUnitF64Error { @@ -19,7 +19,7 @@ impl fmt::Display for ClosedOpenUnitF64Error { } } -#[allow(clippy::unsafe_derive_deserialize)] +#[expect(clippy::unsafe_derive_deserialize)] #[derive(Copy, Clone, Deserialize, Serialize, TypeLayout)] #[repr(transparent)] #[serde(try_from = "f64", into = "f64")] @@ -88,7 +88,6 @@ impl ClosedOpenUnitF64 { } impl PartialEq for ClosedOpenUnitF64 { - #[allow(clippy::unconditional_recursion)] fn eq(&self, other: &Self) -> bool { self.0.eq(&other.0) } diff --git a/necsim/core/bond/src/closed_unit_f64.rs b/necsim/core/bond/src/closed_unit_f64.rs index d5c0bdc02..c35ae9c7b 100644 --- a/necsim/core/bond/src/closed_unit_f64.rs +++ b/necsim/core/bond/src/closed_unit_f64.rs @@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize}; use crate::{ClosedOpenUnitF64, OpenClosedUnitF64}; #[derive(Debug)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct ClosedUnitF64Error(f64); impl fmt::Display for ClosedUnitF64Error { @@ -21,7 +21,7 @@ impl fmt::Display for ClosedUnitF64Error { } } -#[allow(clippy::unsafe_derive_deserialize)] +#[expect(clippy::unsafe_derive_deserialize)] #[derive(Copy, Clone, Serialize, Deserialize, TypeLayout)] #[repr(transparent)] #[serde(try_from = "f64", into = "f64")] @@ -122,7 +122,6 @@ impl From for ClosedUnitF64 { } impl PartialEq for ClosedUnitF64 { - #[allow(clippy::unconditional_recursion)] fn eq(&self, other: &Self) -> bool { self.0.eq(&other.0) } diff --git a/necsim/core/bond/src/non_negative_f64.rs b/necsim/core/bond/src/non_negative_f64.rs index 89e3ea295..32a7624bb 100644 --- a/necsim/core/bond/src/non_negative_f64.rs +++ b/necsim/core/bond/src/non_negative_f64.rs @@ -14,7 +14,7 @@ use necsim_core_maths::MathsCore; use crate::{ClosedOpenUnitF64, ClosedUnitF64, NonPositiveF64, OpenClosedUnitF64, PositiveF64}; #[derive(Debug)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct NonNegativeF64Error(f64); impl fmt::Display for NonNegativeF64Error { @@ -23,7 +23,7 @@ impl fmt::Display for NonNegativeF64Error { } } -#[allow(clippy::unsafe_derive_deserialize)] +#[expect(clippy::unsafe_derive_deserialize)] #[derive(Copy, Clone, Serialize, Deserialize, TypeLayout)] #[repr(transparent)] #[serde(try_from = "f64", into = "f64")] @@ -123,14 +123,14 @@ impl From for NonNegativeF64 { } impl From for NonNegativeF64 { - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] fn from(value: u64) -> Self { Self(value as f64) } } impl From for NonNegativeF64 { - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] fn from(value: usize) -> Self { Self(value as f64) } @@ -161,7 +161,6 @@ impl From for NonNegativeF64 { } impl PartialEq for NonNegativeF64 { - #[allow(clippy::unconditional_recursion)] fn eq(&self, other: &Self) -> bool { self.0.eq(&other.0) } diff --git a/necsim/core/bond/src/non_positive_f64.rs b/necsim/core/bond/src/non_positive_f64.rs index 2e7cce0e8..be91637c9 100644 --- a/necsim/core/bond/src/non_positive_f64.rs +++ b/necsim/core/bond/src/non_positive_f64.rs @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; use crate::NonNegativeF64; #[derive(Debug)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct NonPositiveF64Error(f64); impl fmt::Display for NonPositiveF64Error { @@ -20,7 +20,7 @@ impl fmt::Display for NonPositiveF64Error { } } -#[allow(clippy::unsafe_derive_deserialize)] +#[expect(clippy::unsafe_derive_deserialize)] #[derive(Copy, Clone, Serialize, Deserialize, TypeLayout)] #[repr(transparent)] #[serde(try_from = "f64", into = "f64")] @@ -94,7 +94,6 @@ impl NonPositiveF64 { } impl PartialEq for NonPositiveF64 { - #[allow(clippy::unconditional_recursion)] fn eq(&self, other: &Self) -> bool { self.0.eq(&other.0) } diff --git a/necsim/core/bond/src/non_zero_one_u64.rs b/necsim/core/bond/src/non_zero_one_u64.rs index e376d664d..3423341a0 100644 --- a/necsim/core/bond/src/non_zero_one_u64.rs +++ b/necsim/core/bond/src/non_zero_one_u64.rs @@ -3,7 +3,7 @@ use core::{convert::TryFrom, fmt, num::NonZeroU64}; use serde::{Deserialize, Deserializer, Serialize}; #[derive(Debug)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct NonZeroOneU64Error(u64); impl fmt::Display for NonZeroOneU64Error { diff --git a/necsim/core/bond/src/off_by_one_u32.rs b/necsim/core/bond/src/off_by_one_u32.rs index 14dd1de0d..4bf0bc09f 100644 --- a/necsim/core/bond/src/off_by_one_u32.rs +++ b/necsim/core/bond/src/off_by_one_u32.rs @@ -7,7 +7,7 @@ use core::{ use serde::{Deserialize, Deserializer, Serialize}; #[derive(Debug)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct OffByOneU32Error(u64); impl fmt::Display for OffByOneU32Error { @@ -37,7 +37,7 @@ impl OffByOneU32 { // Err(_) => Err(OffByOneU32Error(value)), // } match value.wrapping_sub(1) { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] value if value <= (u32::MAX as u64) => Ok(Self(value as u32)), _ => Err(OffByOneU32Error(value)), } @@ -50,7 +50,7 @@ impl OffByOneU32 { /// /// The value must be in {1, .., 2^32}. pub const unsafe fn new_unchecked(value: u64) -> Self { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] Self(value.wrapping_sub(1) as u32) } diff --git a/necsim/core/bond/src/off_by_one_u64.rs b/necsim/core/bond/src/off_by_one_u64.rs index 360d04f27..1f8cccb11 100644 --- a/necsim/core/bond/src/off_by_one_u64.rs +++ b/necsim/core/bond/src/off_by_one_u64.rs @@ -10,7 +10,7 @@ use serde::{Deserialize, Deserializer, Serialize}; use crate::{ClosedUnitF64, OffByOneU32}; #[derive(Debug)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct OffByOneU64Error(u128); impl fmt::Display for OffByOneU64Error { @@ -40,7 +40,7 @@ impl OffByOneU64 { // Err(_) => Err(OffByOneU64Error(value)), // } match value.wrapping_sub(1) { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] value if value < (u64::MAX as u128) => Ok(Self(value as u64)), _ => Err(OffByOneU64Error(value)), } @@ -53,7 +53,7 @@ impl OffByOneU64 { /// /// The value must be in {1, .., 2^64}. pub const unsafe fn new_unchecked(value: u128) -> Self { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] Self(value.wrapping_sub(1) as u64) } @@ -128,7 +128,7 @@ impl From for NonZeroU64 { } impl From for f64 { - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] fn from(val: OffByOneU64) -> Self { (val.0 as f64) + 1.0_f64 } @@ -166,9 +166,9 @@ impl Mul for OffByOneU64 { type Output = Self; fn mul(self, other: ClosedUnitF64) -> Self::Output { - #[allow(clippy::cast_possible_truncation)] - #[allow(clippy::cast_sign_loss)] - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_possible_truncation)] + #[expect(clippy::cast_sign_loss)] + #[expect(clippy::cast_precision_loss)] Self(((((self.get() as f64) * other.get()) as u128) - 1) as u64) } } diff --git a/necsim/core/bond/src/open_closed_unit_f64.rs b/necsim/core/bond/src/open_closed_unit_f64.rs index b4b3441dc..d6cfc8900 100644 --- a/necsim/core/bond/src/open_closed_unit_f64.rs +++ b/necsim/core/bond/src/open_closed_unit_f64.rs @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; use crate::NonPositiveF64; #[derive(Debug)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct OpenClosedUnitF64Error(f64); impl fmt::Display for OpenClosedUnitF64Error { @@ -20,7 +20,7 @@ impl fmt::Display for OpenClosedUnitF64Error { } } -#[allow(clippy::unsafe_derive_deserialize)] +#[expect(clippy::unsafe_derive_deserialize)] #[derive(Copy, Clone, Deserialize, Serialize, TypeLayout)] #[repr(transparent)] #[serde(try_from = "f64", into = "f64")] @@ -94,7 +94,6 @@ impl OpenClosedUnitF64 { } impl PartialEq for OpenClosedUnitF64 { - #[allow(clippy::unconditional_recursion)] fn eq(&self, other: &Self) -> bool { self.0.eq(&other.0) } diff --git a/necsim/core/bond/src/positive_f64.rs b/necsim/core/bond/src/positive_f64.rs index de5766741..18616a1d0 100644 --- a/necsim/core/bond/src/positive_f64.rs +++ b/necsim/core/bond/src/positive_f64.rs @@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize}; use crate::NonNegativeF64; #[derive(Debug)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct PositiveF64Error(f64); impl fmt::Display for PositiveF64Error { @@ -21,7 +21,7 @@ impl fmt::Display for PositiveF64Error { } } -#[allow(clippy::unsafe_derive_deserialize)] +#[expect(clippy::unsafe_derive_deserialize)] #[derive(Copy, Clone, Serialize, Deserialize, TypeLayout)] #[repr(transparent)] #[serde(try_from = "f64", into = "f64")] @@ -120,14 +120,13 @@ impl From for PositiveF64 { } impl From for PositiveF64 { - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] fn from(value: NonZeroU64) -> Self { Self(value.get() as f64) } } impl PartialEq for PositiveF64 { - #[allow(clippy::unconditional_recursion)] fn eq(&self, other: &Self) -> bool { self.0.eq(&other.0) } diff --git a/necsim/core/src/cogs/active_lineage_sampler.rs b/necsim/core/src/cogs/active_lineage_sampler.rs index 98df0a19e..0fbf4bbd8 100644 --- a/necsim/core/src/cogs/active_lineage_sampler.rs +++ b/necsim/core/src/cogs/active_lineage_sampler.rs @@ -9,8 +9,6 @@ use super::{ use crate::{lineage::Lineage, simulation::partial::active_lineage_sampler::PartialSimulation}; -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] -#[allow(clippy::no_effect_underscore_binding)] #[contract_trait] pub trait ActiveLineageSampler< M: MathsCore, diff --git a/necsim/core/src/cogs/backup.rs b/necsim/core/src/cogs/backup.rs index 09e8951fc..8bece805d 100644 --- a/necsim/core/src/cogs/backup.rs +++ b/necsim/core/src/cogs/backup.rs @@ -1,6 +1,5 @@ use core::ops::Deref; -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] #[contract_trait] pub trait Backup: Sized { #[must_use] diff --git a/necsim/core/src/cogs/coalescence_sampler.rs b/necsim/core/src/cogs/coalescence_sampler.rs index f4d0aa4da..85fd12cb0 100644 --- a/necsim/core/src/cogs/coalescence_sampler.rs +++ b/necsim/core/src/cogs/coalescence_sampler.rs @@ -12,7 +12,6 @@ use crate::{ use super::{Habitat, LineageStore}; -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] #[contract_trait] pub trait CoalescenceSampler, S: LineageStore>: crate::cogs::Backup + core::fmt::Debug @@ -68,11 +67,7 @@ impl CoalescenceRngSample { pub fn sample_coalescence_index(self, length: u32) -> u32 { // attributes on expressions are experimental // see https://github.com/rust-lang/rust/issues/15701 - #[allow( - clippy::cast_precision_loss, - clippy::cast_possible_truncation, - clippy::cast_sign_loss - )] + #[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)] let index = M::floor(self.0.get() * f64::from(length)) as u32; index } diff --git a/necsim/core/src/cogs/dispersal_sampler.rs b/necsim/core/src/cogs/dispersal_sampler.rs index 00f7e01ed..20ff14a22 100644 --- a/necsim/core/src/cogs/dispersal_sampler.rs +++ b/necsim/core/src/cogs/dispersal_sampler.rs @@ -7,9 +7,6 @@ use crate::{ use super::Habitat; -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] -#[allow(clippy::no_effect_underscore_binding)] -#[allow(clippy::module_name_repetitions)] #[contract_trait] pub trait DispersalSampler, G: RngCore>: crate::cogs::Backup + core::fmt::Debug @@ -25,9 +22,7 @@ pub trait DispersalSampler, G: RngCore>: ) -> Location; } -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] -#[allow(clippy::no_effect_underscore_binding)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[contract_trait] pub trait SeparableDispersalSampler, G: RngCore>: DispersalSampler diff --git a/necsim/core/src/cogs/emigration_exit.rs b/necsim/core/src/cogs/emigration_exit.rs index 45c6d37c3..6c99744ee 100644 --- a/necsim/core/src/cogs/emigration_exit.rs +++ b/necsim/core/src/cogs/emigration_exit.rs @@ -7,12 +7,7 @@ use crate::{ simulation::partial::emigration_exit::PartialSimulation, }; -#[allow( - clippy::inline_always, - clippy::inline_fn_without_body, - clippy::too_many_arguments -)] -#[allow(clippy::no_effect_underscore_binding)] +#[expect(clippy::too_many_arguments)] #[contract_trait] pub trait EmigrationExit, G: RngCore, S: LineageStore>: crate::cogs::Backup + core::fmt::Debug diff --git a/necsim/core/src/cogs/event_sampler.rs b/necsim/core/src/cogs/event_sampler.rs index 1a619935f..61ccb7a02 100644 --- a/necsim/core/src/cogs/event_sampler.rs +++ b/necsim/core/src/cogs/event_sampler.rs @@ -16,7 +16,6 @@ pub struct EventHandler { pub emigration: E, } -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] #[contract_trait] pub trait EventSampler< M: MathsCore, diff --git a/necsim/core/src/cogs/habitat.rs b/necsim/core/src/cogs/habitat.rs index 105ed41b6..ef2170ecf 100644 --- a/necsim/core/src/cogs/habitat.rs +++ b/necsim/core/src/cogs/habitat.rs @@ -4,11 +4,6 @@ use crate::landscape::{IndexedLocation, LandscapeExtent, Location}; use super::{MathsCore, RngCore}; -#[allow( - clippy::inline_always, - clippy::inline_fn_without_body, - clippy::no_effect_underscore_binding -)] #[contract_trait] pub trait Habitat: crate::cogs::Backup + core::fmt::Debug + Sized { type LocationIterator<'a>: Iterator + 'a @@ -60,12 +55,7 @@ pub trait Habitat: crate::cogs::Backup + core::fmt::Debug + Sized fn iter_habitable_locations(&self) -> Self::LocationIterator<'_>; } -#[allow(clippy::module_name_repetitions)] -#[allow( - clippy::inline_always, - clippy::inline_fn_without_body, - clippy::no_effect_underscore_binding -)] +#[expect(clippy::module_name_repetitions)] #[contract_trait] pub trait UniformlySampleableHabitat>: Habitat { #[debug_ensures( diff --git a/necsim/core/src/cogs/immigration_entry.rs b/necsim/core/src/cogs/immigration_entry.rs index 03d4d8fbe..1cbb2500b 100644 --- a/necsim/core/src/cogs/immigration_entry.rs +++ b/necsim/core/src/cogs/immigration_entry.rs @@ -2,7 +2,6 @@ use crate::lineage::MigratingLineage; use super::MathsCore; -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] #[contract_trait] pub trait ImmigrationEntry: crate::cogs::Backup + core::fmt::Debug { #[must_use] diff --git a/necsim/core/src/cogs/lineage_reference.rs b/necsim/core/src/cogs/lineage_reference.rs index 162dfe93c..e468add12 100644 --- a/necsim/core/src/cogs/lineage_reference.rs +++ b/necsim/core/src/cogs/lineage_reference.rs @@ -2,7 +2,6 @@ use core::hash::Hash; use super::{Habitat, MathsCore}; -#[allow(clippy::module_name_repetitions)] pub trait LineageReference>: crate::cogs::Backup + PartialEq + Eq + Hash + core::fmt::Debug { diff --git a/necsim/core/src/cogs/lineage_store.rs b/necsim/core/src/cogs/lineage_store.rs index afc0d319d..4575810e4 100644 --- a/necsim/core/src/cogs/lineage_store.rs +++ b/necsim/core/src/cogs/lineage_store.rs @@ -6,7 +6,6 @@ use crate::{ lineage::{GlobalLineageReference, Lineage}, }; -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] #[contract_trait] pub trait LineageStore>: crate::cogs::Backup + Sized + core::fmt::Debug @@ -23,9 +22,7 @@ pub trait LineageStore>: ) -> Option<&Lineage>; } -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] -#[allow(clippy::no_effect_underscore_binding)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[contract_trait] pub trait LocallyCoherentLineageStore>: LineageStore + for<'a> Index<&'a Self::LocalLineageReference, Output = Lineage> @@ -89,9 +86,7 @@ pub trait LocallyCoherentLineageStore>: ) -> Lineage; } -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] -#[allow(clippy::no_effect_underscore_binding)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[contract_trait] pub trait GloballyCoherentLineageStore>: LocallyCoherentLineageStore diff --git a/necsim/core/src/cogs/rng.rs b/necsim/core/src/cogs/rng.rs index f346cf52f..77adf8091 100644 --- a/necsim/core/src/cogs/rng.rs +++ b/necsim/core/src/cogs/rng.rs @@ -17,7 +17,7 @@ use crate::{ landscape::IndexedLocation, }; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait RngCore: crate::cogs::Backup + Sized + Send + Clone + core::fmt::Debug + Serialize + DeserializeOwned { @@ -30,7 +30,7 @@ pub trait RngCore: fn sample_u64(&mut self) -> u64; } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait SeedableRng: RngCore { #[must_use] fn seed_from_u64(mut state: u64) -> Self { @@ -48,9 +48,8 @@ pub trait SeedableRng: RngCore { state = state.wrapping_mul(MUL).wrapping_add(INC); // Use PCG output function with to_le to generate x: - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let xorshifted = (((state >> 18) ^ state) >> 27) as u32; - #[allow(clippy::cast_possible_truncation)] let rot = (state >> 59) as u32; let x = xorshifted.rotate_right(rot).to_le(); @@ -66,8 +65,7 @@ pub trait SeedableRng: RngCore { impl> SeedableRng for R {} -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[contract_trait] pub trait RngSampler: RngCore { #[must_use] @@ -75,7 +73,7 @@ pub trait RngSampler: RngCore { /// Samples a uniform sample within `[0.0, 1.0)`, i.e. `0.0 <= X < 1.0` fn sample_uniform_closed_open(&mut self) -> ClosedOpenUnitF64 { // http://prng.di.unimi.it -> Generating uniform doubles in the unit interval - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] let u01 = ((self.sample_u64() >> 11) as f64) * f64::from_bits(0x3CA0_0000_0000_0000_u64); // 0x1.0p-53 unsafe { ClosedOpenUnitF64::new_unchecked(u01) } @@ -86,7 +84,7 @@ pub trait RngSampler: RngCore { /// Samples a uniform sample within `(0.0, 1.0]`, i.e. `0.0 < X <= 1.0` fn sample_uniform_open_closed(&mut self) -> OpenClosedUnitF64 { // http://prng.di.unimi.it -> Generating uniform doubles in the unit interval - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] let u01 = (((self.sample_u64() >> 11) + 1) as f64) * f64::from_bits(0x3CA0_0000_0000_0000_u64); // 0x1.0p-53 @@ -99,7 +97,7 @@ pub trait RngSampler: RngCore { fn sample_index(&mut self, length: NonZeroUsize) -> usize { // attributes on expressions are experimental // see https://github.com/rust-lang/rust/issues/15701 - #[allow( + #[expect( clippy::cast_precision_loss, clippy::cast_possible_truncation, clippy::cast_sign_loss @@ -116,11 +114,7 @@ pub trait RngSampler: RngCore { fn sample_index_u32(&mut self, length: OffByOneU32) -> u32 { // attributes on expressions are experimental // see https://github.com/rust-lang/rust/issues/15701 - #[allow( - clippy::cast_precision_loss, - clippy::cast_possible_truncation, - clippy::cast_sign_loss - )] + #[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)] let index = M::floor(self.sample_uniform_closed_open().get() * (f64::from(length.sub_one()) + 1.0)) as u32; @@ -134,7 +128,7 @@ pub trait RngSampler: RngCore { fn sample_index_u64(&mut self, length: OffByOneU64) -> u64 { // attributes on expressions are experimental // see https://github.com/rust-lang/rust/issues/15701 - #[allow( + #[expect( clippy::cast_precision_loss, clippy::cast_possible_truncation, clippy::cast_sign_loss @@ -152,7 +146,7 @@ pub trait RngSampler: RngCore { fn sample_index_u128(&mut self, length: NonZeroU128) -> u128 { // attributes on expressions are experimental // see https://github.com/rust-lang/rust/issues/15701 - #[allow( + #[expect( clippy::cast_precision_loss, clippy::cast_possible_truncation, clippy::cast_sign_loss @@ -202,12 +196,12 @@ pub trait RngSampler: RngCore { impl> RngSampler for R {} -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait PrimeableRng: RngCore { fn prime_with(&mut self, location_index: u64, time_index: u64); } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait HabitatPrimeableRng>: PrimeableRng { #[inline] fn prime_with_habitat( @@ -225,7 +219,7 @@ pub trait HabitatPrimeableRng>: PrimeableRng { impl, H: Habitat> HabitatPrimeableRng for R {} -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait SplittableRng: RngCore { #[must_use] fn split(self) -> (Self, Self); diff --git a/necsim/core/src/cogs/speciation_probability.rs b/necsim/core/src/cogs/speciation_probability.rs index 8584228d6..81b483fae 100644 --- a/necsim/core/src/cogs/speciation_probability.rs +++ b/necsim/core/src/cogs/speciation_probability.rs @@ -5,7 +5,6 @@ use crate::{ landscape::Location, }; -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] #[contract_trait] pub trait SpeciationProbability>: crate::cogs::Backup + core::fmt::Debug diff --git a/necsim/core/src/cogs/turnover_rate.rs b/necsim/core/src/cogs/turnover_rate.rs index fce772b01..613498bf2 100644 --- a/necsim/core/src/cogs/turnover_rate.rs +++ b/necsim/core/src/cogs/turnover_rate.rs @@ -5,7 +5,6 @@ use crate::{ landscape::Location, }; -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] #[contract_trait] pub trait TurnoverRate>: crate::cogs::Backup + core::fmt::Debug diff --git a/necsim/core/src/event.rs b/necsim/core/src/event.rs index af42ac633..c5d8ce326 100644 --- a/necsim/core/src/event.rs +++ b/necsim/core/src/event.rs @@ -11,8 +11,8 @@ use crate::{ lineage::{GlobalLineageReference, LineageInteraction}, }; -#[allow(clippy::module_name_repetitions)] -#[allow(clippy::unsafe_derive_deserialize)] +#[expect(clippy::module_name_repetitions)] +#[expect(clippy::unsafe_derive_deserialize)] #[derive(Debug, Clone, Serialize, Deserialize, TypeLayout)] #[repr(C)] pub struct PackedEvent { @@ -35,13 +35,13 @@ impl PackedEvent { } } -#[allow(dead_code)] +#[expect(dead_code)] const EXCESSIVE_PACKED_EVENT_ERROR: [(); 1 - { const ASSERT: bool = core::mem::size_of::() == 56; ASSERT } as usize] = []; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq, Ord, PartialOrd, Hash)] pub enum EventType { Speciation, @@ -54,7 +54,7 @@ pub struct Dispersal { pub interaction: LineageInteraction, } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, Clone, Serialize, Deserialize, TypeLayout)] #[repr(C)] pub struct SpeciationEvent { @@ -64,13 +64,13 @@ pub struct SpeciationEvent { pub origin: IndexedLocation, } -#[allow(dead_code)] +#[expect(dead_code)] const EXCESSIVE_SPECIATION_EVENT_ERROR: [(); 1 - { const ASSERT: bool = core::mem::size_of::() == 40; ASSERT } as usize] = []; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, Clone, Serialize, Deserialize)] pub struct DispersalEvent { pub global_lineage_reference: GlobalLineageReference, @@ -81,20 +81,20 @@ pub struct DispersalEvent { pub interaction: LineageInteraction, } -#[allow(dead_code)] +#[expect(dead_code)] const EXCESSIVE_DISPERSAL_EVENT_ERROR: [(); 1 - { const ASSERT: bool = core::mem::size_of::() == 64; ASSERT } as usize] = []; -#[allow(dead_code)] +#[expect(dead_code)] const EXCESSIVE_OPTION_DISPERSAL_EVENT_ERROR: [(); 1 - { const ASSERT: bool = core::mem::size_of::>() == core::mem::size_of::(); ASSERT } as usize] = []; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub enum TypedEvent { Speciation(SpeciationEvent), Dispersal(DispersalEvent), diff --git a/necsim/core/src/landscape/extent.rs b/necsim/core/src/landscape/extent.rs index f4b840f2f..de8d59bab 100644 --- a/necsim/core/src/landscape/extent.rs +++ b/necsim/core/src/landscape/extent.rs @@ -2,7 +2,7 @@ use necsim_core_bond::{OffByOneU32, OffByOneU64}; use super::Location; -#[allow(clippy::module_name_repetitions, clippy::unsafe_derive_deserialize)] +#[allow(clippy::module_name_repetitions, clippy::unsafe_derive_deserialize)] // FIXME: use expect #[derive(PartialEq, Eq, Clone, Debug, serde::Deserialize, serde::Serialize, TypeLayout)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(ignore))] diff --git a/necsim/core/src/landscape/location.rs b/necsim/core/src/landscape/location.rs index 7d8b2cf26..4ea067e7b 100644 --- a/necsim/core/src/landscape/location.rs +++ b/necsim/core/src/landscape/location.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; -#[allow(clippy::module_name_repetitions)] +#[allow(clippy::module_name_repetitions)] // FIXME: use expect #[derive( Eq, PartialEq, PartialOrd, Ord, Clone, Hash, Debug, Serialize, Deserialize, TypeLayout, )] @@ -39,7 +39,7 @@ impl From for Location { #[derive( Eq, PartialEq, PartialOrd, Ord, Clone, Hash, Debug, Serialize, Deserialize, TypeLayout, )] -#[allow(clippy::module_name_repetitions)] +#[allow(clippy::module_name_repetitions)] // FIXME: use expect #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[repr(C)] #[cfg_attr(feature = "cuda", cuda(ignore))] diff --git a/necsim/core/src/landscape/mod.rs b/necsim/core/src/landscape/mod.rs index 41a00b87f..9b0e873ee 100644 --- a/necsim/core/src/landscape/mod.rs +++ b/necsim/core/src/landscape/mod.rs @@ -1,6 +1,6 @@ mod extent; mod location; -#[allow(clippy::module_name_repetitions)] +#[allow(clippy::module_name_repetitions)] // FIXME: use expect pub use extent::{LandscapeExtent, LocationIterator}; pub use location::{IndexedLocation, Location}; diff --git a/necsim/core/src/lineage.rs b/necsim/core/src/lineage.rs index 57e85b9c3..2f9298a83 100644 --- a/necsim/core/src/lineage.rs +++ b/necsim/core/src/lineage.rs @@ -56,7 +56,7 @@ impl<'de> Deserialize<'de> for GlobalLineageReference { impl> LineageReference for GlobalLineageReference {} -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] pub enum LineageInteraction { None, @@ -88,7 +88,7 @@ impl From> for LineageInteraction { } } -#[allow(clippy::module_name_repetitions)] +#[allow(clippy::module_name_repetitions)] // FIXME: use expect #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, TypeLayout)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[repr(C)] @@ -110,7 +110,6 @@ pub struct Lineage { impl Lineage { #[must_use] - #[allow(clippy::no_effect_underscore_binding)] #[debug_ensures( ret.indexed_location == old(indexed_location.clone()), "stores the indexed_location" @@ -162,7 +161,7 @@ pub enum TieBreaker { PreferLocal = 1, } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, PartialEq, Serialize, Deserialize)] #[repr(C)] pub struct MigratingLineage { diff --git a/necsim/core/src/reporter/combinator.rs b/necsim/core/src/reporter/combinator.rs index 0129bdc87..414c56f63 100644 --- a/necsim/core/src/reporter/combinator.rs +++ b/necsim/core/src/reporter/combinator.rs @@ -3,7 +3,7 @@ use crate::{ reporter::{boolean::Or, Reporter}, }; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct ReporterCombinator { front: F, diff --git a/necsim/core/src/reporter/filter.rs b/necsim/core/src/reporter/filter.rs index 57ef8c876..0bc4d0893 100644 --- a/necsim/core/src/reporter/filter.rs +++ b/necsim/core/src/reporter/filter.rs @@ -10,7 +10,6 @@ use crate::{ }, }; -#[allow(clippy::module_name_repetitions)] #[repr(transparent)] pub struct FilteredReporter< R: Reporter, diff --git a/necsim/core/src/reporter/group.rs b/necsim/core/src/reporter/group.rs index d3e800a05..ca50ef1b9 100644 --- a/necsim/core/src/reporter/group.rs +++ b/necsim/core/src/reporter/group.rs @@ -1,5 +1,5 @@ #[macro_export] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] macro_rules! ReporterGroup { () => { $crate::reporter::NullReporter @@ -15,7 +15,7 @@ macro_rules! ReporterGroup { } #[macro_export] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] macro_rules! ReporterUnGroup { ($reporter:expr => []) => {}; ($reporter:expr => [$first_reporter:ident $(,$reporter_tail:ident)*]) => { diff --git a/necsim/core/src/reporter/impl.rs b/necsim/core/src/reporter/impl.rs index 315086200..d2c7ae505 100644 --- a/necsim/core/src/reporter/impl.rs +++ b/necsim/core/src/reporter/impl.rs @@ -1,5 +1,5 @@ #[macro_export] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] macro_rules! impl_report { // Special case: Ignored = MaybeUsed ($(#[$metas:meta])* $([$default:tt])? $target:ident(&mut $this:ident, $value:ident: Ignored) {}) => @@ -67,7 +67,7 @@ macro_rules! impl_report { } #[macro_export] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] macro_rules! impl_finalise { ($(#[$metas:meta])* ($self:ident) $code:block) => { $(#[$metas])* diff --git a/necsim/core/src/reporter/mod.rs b/necsim/core/src/reporter/mod.rs index a934f58b1..8a5f5a19b 100644 --- a/necsim/core/src/reporter/mod.rs +++ b/necsim/core/src/reporter/mod.rs @@ -12,11 +12,11 @@ use used::MaybeUsed; pub mod boolean; pub mod used; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub use combinator::ReporterCombinator; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub use filter::FilteredReporter; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub use null::NullReporter; pub trait Reporter: core::fmt::Debug { diff --git a/necsim/core/src/reporter/null.rs b/necsim/core/src/reporter/null.rs index a5ac741fa..77aad21a6 100644 --- a/necsim/core/src/reporter/null.rs +++ b/necsim/core/src/reporter/null.rs @@ -1,6 +1,6 @@ use crate::{impl_report, reporter::Reporter}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct NullReporter; diff --git a/necsim/core/src/reporter/used.rs b/necsim/core/src/reporter/used.rs index 8d83cd198..5331b69c1 100644 --- a/necsim/core/src/reporter/used.rs +++ b/necsim/core/src/reporter/used.rs @@ -2,7 +2,7 @@ use core::marker::PhantomData; use crate::reporter::boolean::{Boolean, False, True}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[repr(transparent)] pub struct MaybeUsed { inner: T, diff --git a/necsim/core/src/simulation/builder.rs b/necsim/core/src/simulation/builder.rs index fc589b7ec..1bd3a8f5d 100644 --- a/necsim/core/src/simulation/builder.rs +++ b/necsim/core/src/simulation/builder.rs @@ -7,7 +7,7 @@ use crate::cogs::{ }; #[derive(Debug)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct SimulationBuilder< M: MathsCore, H: Habitat, diff --git a/necsim/core/src/simulation/mod.rs b/necsim/core/src/simulation/mod.rs index 29368e5a6..e8edfd5bd 100644 --- a/necsim/core/src/simulation/mod.rs +++ b/necsim/core/src/simulation/mod.rs @@ -18,7 +18,7 @@ use crate::{ reporter::Reporter, }; -#[allow(clippy::module_name_repetitions)] +#[allow(clippy::module_name_repetitions)] // FIXME: use expect pub use builder::{Simulation, SimulationBuilder}; use necsim_core_bond::{NonNegativeF64, PositiveF64}; diff --git a/necsim/impls/cuda/src/cogs/maths.rs b/necsim/impls/cuda/src/cogs/maths.rs index 4b5df0d36..fbeff7055 100644 --- a/necsim/impls/cuda/src/cogs/maths.rs +++ b/necsim/impls/cuda/src/cogs/maths.rs @@ -1,7 +1,6 @@ use necsim_core::cogs::MathsCore; #[derive(Clone, Debug)] -#[allow(clippy::module_name_repetitions)] pub enum NvptxMathsCore {} impl MathsCore for NvptxMathsCore { @@ -25,7 +24,7 @@ impl MathsCore for NvptxMathsCore { unsafe { const FRAC_1_LOG2_E: f64 = 1.0_f64 / core::f64::consts::LOG2_E; - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let x: f32 = x as f32; let f: f32; @@ -53,7 +52,7 @@ impl MathsCore for NvptxMathsCore { #[cfg(target_os = "cuda")] unsafe { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let x: f32 = (x * core::f64::consts::LOG2_E) as f32; let f: f32; @@ -87,9 +86,9 @@ impl MathsCore for NvptxMathsCore { // https://stackoverflow.com/a/54273307 // by https://stackoverflow.com/users/2341466/andars // Licensed under CC BY-SA 4.0 - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let x: f32 = x as f32; - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let exp: f32 = exp as f32; let log2_x: f32; @@ -118,7 +117,7 @@ impl MathsCore for NvptxMathsCore { #[cfg(target_os = "cuda")] unsafe { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let x: f32 = x as f32; let f: f32; @@ -142,7 +141,7 @@ impl MathsCore for NvptxMathsCore { #[cfg(target_os = "cuda")] unsafe { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let x: f32 = x as f32; let f: f32; diff --git a/necsim/impls/cuda/src/cogs/rng.rs b/necsim/impls/cuda/src/cogs/rng.rs index 8237ed1cf..ca1aa886c 100644 --- a/necsim/impls/cuda/src/cogs/rng.rs +++ b/necsim/impls/cuda/src/cogs/rng.rs @@ -10,7 +10,7 @@ use rust_cuda::{ use serde::{Deserialize, Deserializer, Serialize, Serializer}; -#[allow(clippy::module_name_repetitions)] +#[allow(clippy::module_name_repetitions)] // FIXME: use expect #[derive(Debug, Clone, rust_cuda::lend::LendRustToCuda)] #[cuda(free = "M", free = "R")] pub struct CudaRng diff --git a/necsim/impls/cuda/src/event_buffer.rs b/necsim/impls/cuda/src/event_buffer.rs index 1a08d85ca..51d2afb8f 100644 --- a/necsim/impls/cuda/src/event_buffer.rs +++ b/necsim/impls/cuda/src/event_buffer.rs @@ -32,7 +32,7 @@ use necsim_core::impl_report; use super::utils::MaybeSome; -#[allow(clippy::module_name_repetitions, clippy::type_complexity)] +#[allow(clippy::module_name_repetitions, clippy::type_complexity)] // FIXME: use expect #[derive(rust_cuda::lend::LendRustToCuda)] #[cuda(free = "ReportSpeciation", free = "ReportDispersal")] pub struct EventBuffer { @@ -143,7 +143,7 @@ impl let block_size = (block_size.x * block_size.y * block_size.z) as usize; let grid_size = (grid_size.x * grid_size.y * grid_size.z) as usize; - #[allow(clippy::bool_to_int_with_if)] + #[expect(clippy::bool_to_int_with_if)] let max_events = if ReportDispersal::VALUE { max_events } else if ReportSpeciation::VALUE { diff --git a/necsim/impls/cuda/src/utils.rs b/necsim/impls/cuda/src/utils.rs index 39c1c8285..754a8da89 100644 --- a/necsim/impls/cuda/src/utils.rs +++ b/necsim/impls/cuda/src/utils.rs @@ -9,10 +9,10 @@ pub struct MaybeSome(MaybeUninit); impl MaybeSome { #[cfg(not(target_os = "cuda"))] - #[allow(non_upper_case_globals)] + #[expect(non_upper_case_globals)] // FIXME: use expect pub(crate) const None: Self = Self(MaybeUninit::uninit()); - #[allow(non_snake_case)] + #[expect(non_snake_case)] // FIXME: use expect pub(crate) fn Some(value: T) -> Self { Self(MaybeUninit::new(value)) } diff --git a/necsim/impls/cuda/src/value_buffer.rs b/necsim/impls/cuda/src/value_buffer.rs index b1dc71f1a..522cba469 100644 --- a/necsim/impls/cuda/src/value_buffer.rs +++ b/necsim/impls/cuda/src/value_buffer.rs @@ -20,7 +20,7 @@ use super::utils::MaybeSome; #[derive(rust_cuda::lend::LendRustToCuda)] #[cuda(free = "T")] -#[allow(clippy::module_name_repetitions)] +#[allow(clippy::module_name_repetitions)] // FIXME: use expect pub struct ValueBuffer where T: StackOnly + PortableBitSemantics + TypeGraphLayout, @@ -140,7 +140,6 @@ impl ValueBuffer { pub fn take_value_for_core(&mut self) -> Option { - #[allow(clippy::option_if_let_else)] if let Some(mask) = self.mask.get_mut(0) { mask.write(false); diff --git a/necsim/impls/no-std/src/alias/mod.rs b/necsim/impls/no-std/src/alias/mod.rs index 558416936..afe730c12 100644 --- a/necsim/impls/no-std/src/alias/mod.rs +++ b/necsim/impls/no-std/src/alias/mod.rs @@ -7,8 +7,8 @@ use necsim_core_bond::{ClosedUnitF64, NonNegativeF64}; pub mod packed; -#[allow(clippy::module_name_repetitions)] -#[allow(non_snake_case)] +#[expect(clippy::module_name_repetitions)] +#[allow(non_snake_case)] // FIXME: use expect #[derive(Clone)] pub struct AliasMethodSampler { Us: Vec, @@ -17,7 +17,6 @@ pub struct AliasMethodSampler { } impl AliasMethodSampler { - #[allow(clippy::no_effect_underscore_binding)] #[debug_requires(!event_weights.is_empty(), "event_weights is non-empty")] #[debug_ensures( ret.Es.iter().eq(old(event_weights).iter().map(|(e, _p)| e)), @@ -31,11 +30,11 @@ impl AliasMethodSampler { "full buckets sample the same event just in case" )] pub fn new(event_weights: &[(E, NonNegativeF64)]) -> Self { - #[allow(non_snake_case)] + #[allow(non_snake_case)] // FIXME: use expect let mut Us = Vec::with_capacity(event_weights.len()); - #[allow(non_snake_case)] + #[allow(non_snake_case)] // FIXME: use expect let mut Es = Vec::with_capacity(event_weights.len()); - #[allow(non_snake_case)] + #[allow(non_snake_case)] // FIXME: use expect let mut Ks = Vec::with_capacity(event_weights.len()); let total_weight: NonNegativeF64 = event_weights.iter().map(|(_e, p)| *p).sum(); @@ -83,7 +82,7 @@ impl AliasMethodSampler { .for_each(|i| Us[i] = NonNegativeF64::one()); // Safety: The bucket weights are now probabilities in [0.0; 1.0] - #[allow(non_snake_case)] + #[allow(non_snake_case)] // FIXME: use expect let Us = unsafe { core::mem::transmute::, Vec>(Us) }; Self { Us, Es, Ks } @@ -95,14 +94,10 @@ impl AliasMethodSampler { let x = rng.sample_uniform_closed_open(); - #[allow( - clippy::cast_precision_loss, - clippy::cast_possible_truncation, - clippy::cast_sign_loss - )] + #[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)] let i = M::floor(x.get() * (self.Es.len() as f64)) as usize; // index into events - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] let y = x.get() * (self.Es.len() as f64) - (i as f64); // U(0,1) to compare against U[i] if y < self.Us[i].get() { diff --git a/necsim/impls/no-std/src/alias/packed.rs b/necsim/impls/no-std/src/alias/packed.rs index 7548d7529..d3072921e 100644 --- a/necsim/impls/no-std/src/alias/packed.rs +++ b/necsim/impls/no-std/src/alias/packed.rs @@ -5,7 +5,6 @@ use alloc::vec::Vec; use necsim_core::cogs::{MathsCore, RngCore}; use necsim_core_bond::{ClosedUnitF64, NonNegativeF64}; -#[allow(clippy::module_name_repetitions)] #[derive(Clone, Debug, TypeLayout)] #[repr(C)] pub struct AliasMethodSamplerAtom { @@ -14,7 +13,6 @@ pub struct AliasMethodSamplerAtom { k: E, } -#[allow(dead_code)] struct AliasMethodSamplerAtomRaw { u: NonNegativeF64, e: E, @@ -39,7 +37,6 @@ impl AliasMethodSamplerAtom { self.u = self.u.one_minus(); } - #[allow(clippy::no_effect_underscore_binding)] #[debug_requires(!event_weights.is_empty(), "event_weights is non-empty")] #[debug_requires( event_weights.iter().all(|(_e, p)| *p >= 0.0_f64), @@ -57,7 +54,6 @@ impl AliasMethodSamplerAtom { "full buckets sample the same event just in case" )] pub fn create(event_weights: &[(E, NonNegativeF64)]) -> Vec> { - #[allow(non_snake_case)] let mut alias_samplers = Vec::with_capacity(event_weights.len()); let total_weight: NonNegativeF64 = event_weights.iter().map(|(_e, p)| *p).sum(); @@ -126,7 +122,6 @@ impl AliasMethodSamplerAtom { Self::sample_event_with_cdf_limit(alias_samplers, rng, ClosedUnitF64::one()) } - #[allow(clippy::no_effect_underscore_binding)] #[debug_requires(!alias_samplers.is_empty(), "alias_samplers is non-empty")] #[debug_ensures( old(alias_samplers).iter().map(|s| s.e).any(|e| e == ret), @@ -139,18 +134,14 @@ impl AliasMethodSamplerAtom { ) -> E { use necsim_core::cogs::RngSampler; - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] let f = rng.sample_uniform_closed_open().get() * limit.get() * (alias_samplers.len() as f64); - #[allow( - clippy::cast_precision_loss, - clippy::cast_possible_truncation, - clippy::cast_sign_loss - )] + #[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)] let i = M::floor(f) as usize; // index into events - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] let y = f - (i as f64); // U(0,1) to compare against U[i] let sample = &alias_samplers[i]; diff --git a/necsim/impls/no-std/src/array2d.rs b/necsim/impls/no-std/src/array2d.rs index f55364d98..7cc6871f5 100644 --- a/necsim/impls/no-std/src/array2d.rs +++ b/necsim/impls/no-std/src/array2d.rs @@ -352,7 +352,7 @@ impl> Array2D { Ok(self.array[start..end].iter()) } - #[allow(clippy::missing_panics_doc)] + #[expect(clippy::missing_panics_doc)] /// Returns an [`Iterator`] over all rows. Each [`Item`] is itself another /// [`Iterator`] over references to the elements in that row. /// diff --git a/necsim/impls/no-std/src/cache.rs b/necsim/impls/no-std/src/cache.rs index bfcd00d83..1da715d7c 100644 --- a/necsim/impls/no-std/src/cache.rs +++ b/necsim/impls/no-std/src/cache.rs @@ -3,7 +3,7 @@ use core::hash::{BuildHasher, Hash}; use fnv::FnvBuildHasher; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct DirectMappedCache { cache: Box<[Option]>, build_hasher: S, @@ -43,7 +43,7 @@ impl DirectMappedCache { let hash = self.build_hasher.hash_one(&value); - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let index = (hash % (self.capacity() as u64)) as usize; let bucket = &mut self.cache[index]; diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/individual/mod.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/individual/mod.rs index 2abdb6174..a1349d458 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/individual/mod.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/individual/mod.rs @@ -18,7 +18,7 @@ use super::sampler::stack::DynamicAliasMethodStackSampler; mod sampler; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct IndividualAliasActiveLineageSampler< M: MathsCore, H: Habitat, @@ -35,7 +35,7 @@ pub struct IndividualAliasActiveLineageSampler< alias_sampler: DynamicAliasMethodStackSampler, number_active_lineages: usize, last_event_time: NonNegativeF64, - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] marker: PhantomData<(M, H, G, S, X, D, C, T, N, E, I)>, } @@ -76,7 +76,7 @@ impl< where H: 'h, { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let capacity = origin_sampler.full_upper_bound_size_hint() as usize; let mut lineage_store = S::with_capacity(origin_sampler.habitat(), capacity); diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/location/mod.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/location/mod.rs index cecc4cd34..94ae62269 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/location/mod.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/location/mod.rs @@ -21,7 +21,7 @@ use super::sampler::indexed::DynamicAliasMethodIndexedSampler; mod sampler; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct LocationAliasActiveLineageSampler< M: MathsCore, H: Habitat, @@ -38,7 +38,7 @@ pub struct LocationAliasActiveLineageSampler< alias_sampler: DynamicAliasMethodIndexedSampler, number_active_lineages: usize, last_event_time: NonNegativeF64, - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] marker: PhantomData<(M, H, G, S, X, D, C, T, N, E, I)>, } @@ -94,7 +94,7 @@ impl< where H: 'h, { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let capacity = origin_sampler.full_upper_bound_size_hint() as usize; let mut lineage_store = S::with_capacity(origin_sampler.habitat(), capacity); diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/indexed/mod.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/indexed/mod.rs index 029ec46d8..db3c68086 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/indexed/mod.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/indexed/mod.rs @@ -22,7 +22,6 @@ struct RejectionSamplingGroup { total_weight: u128, } -#[allow(clippy::module_name_repetitions)] pub struct DynamicAliasMethodIndexedSampler { exponents: Vec, groups: Vec>, diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/indexed/tests.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/indexed/tests.rs index da31ab406..7c7926802 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/indexed/tests.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/indexed/tests.rs @@ -25,7 +25,7 @@ fn singular_event_group() { } #[test] -#[allow(clippy::too_many_lines)] +#[expect(clippy::too_many_lines)] fn add_remove_event_group() { let mut group = RejectionSamplingGroup::new(0_u8, 1_u64); @@ -203,7 +203,7 @@ fn sample_single_group() { tally[sample as usize] += 1; } - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] for (i, c) in tally.iter().enumerate() { let target = (((6 + i) as f64) / 51.0_f64) * 1000.0; let measure = ((*c as f64) / (N as f64)) * 1000.0; @@ -273,7 +273,7 @@ fn singular_event_group_full() { } #[test] -#[allow(clippy::too_many_lines)] +#[expect(clippy::too_many_lines)] fn add_remove_event_full() { let mut sampler = DynamicAliasMethodIndexedSampler::default(); assert_eq!(sampler.total_weight(), NonNegativeF64::zero()); @@ -604,7 +604,7 @@ fn add_remove_event_full() { } #[test] -#[allow(clippy::too_many_lines)] +#[expect(clippy::too_many_lines)] fn add_update_event_full() { let mut sampler = DynamicAliasMethodIndexedSampler::default(); assert_eq!(sampler.total_weight(), NonNegativeF64::zero()); @@ -934,7 +934,7 @@ fn sample_single_group_full() { tally[sample as usize] += 1; } - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] for (i, c) in tally.iter().enumerate() { let target = (((6 + i) as f64) / 51.0_f64) * 1000.0; let measure = ((*c as f64) / (N as f64)) * 1000.0; @@ -980,7 +980,7 @@ fn sample_three_groups_full() { tally[sample as usize - 1] += 1; } - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] for (i, c) in tally.iter().enumerate() { let target = (((i + 1) as f64) / 21.0_f64) * 1000.0; let measure = ((*c as f64) / (N as f64)) * 1000.0; @@ -1022,7 +1022,7 @@ fn sample_three_groups_full_reverse() { tally[sample as usize - 1] += 1; } - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] for (i, c) in tally.iter().enumerate() { let target = (((i + 1) as f64) / 21.0_f64) * 1000.0; let measure = ((*c as f64) / (N as f64)) * 1000.0; @@ -1078,7 +1078,7 @@ impl DummyRng { fn new(mut vec: Vec) -> Self { vec.reverse(); - #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] + #[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)] Self( vec.into_iter() .map(|u01| ((u01 / f64::from_bits(0x3CA0_0000_0000_0000_u64)) as u64) << 11) diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/mod.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/mod.rs index 745151bec..3b4d3ec30 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/mod.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/mod.rs @@ -15,12 +15,11 @@ struct PositiveF64Decomposed { fn decompose_weight(weight: PositiveF64) -> PositiveF64Decomposed { let bits = weight.get().to_bits(); - #[allow(clippy::cast_possible_truncation)] let mut exponent: i16 = ((bits >> 52) & 0x7ff_u64) as i16; let mantissa = if exponent == 0 { // Ensure that subnormal floats are presented internally as if they were normal - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let subnormal_exponent = (bits.leading_zeros() as i16) - 12; exponent -= subnormal_exponent; @@ -37,7 +36,7 @@ fn decompose_weight(weight: PositiveF64) -> PositiveF64Decomposed { } } -#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] +#[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)] fn compose_weight(mut exponent: i16, mut mantissa: u128) -> NonNegativeF64 { if mantissa == 0 { return NonNegativeF64::zero(); @@ -63,7 +62,7 @@ fn compose_weight(mut exponent: i16, mut mantissa: u128) -> NonNegativeF64 { let mantissa_u64 = ((mantissa >> (excess_exponent - 1022 - exponent)) & 0x000f_ffff_ffff_ffff_u128) as u64; - #[allow(clippy::let_and_return)] + #[allow(clippy::let_and_return)] // FIXME: use expect { mantissa_u64 } diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/stack/mod.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/stack/mod.rs index 63ae4c224..8aaf42144 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/stack/mod.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/stack/mod.rs @@ -19,7 +19,6 @@ struct RejectionSamplingGroup { total_weight: u128, } -#[allow(clippy::module_name_repetitions)] pub struct DynamicAliasMethodStackSampler { exponents: Vec, groups: Vec>, diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/stack/tests.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/stack/tests.rs index 9bc1b6017..c3ca4e807 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/stack/tests.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/alias/sampler/stack/tests.rs @@ -109,7 +109,7 @@ fn sample_single_group() { tally[sample as usize] += 1; } - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] for (i, c) in tally.iter().enumerate() { let target = (((6 + i) as f64) / 51.0_f64) * 1000.0; let measure = ((*c as f64) / (N as f64)) * 1000.0; @@ -170,7 +170,7 @@ fn singular_event_group_full() { } #[test] -#[allow(clippy::too_many_lines)] +#[expect(clippy::too_many_lines)] fn add_remove_event_full() { let mut sampler = DynamicAliasMethodStackSampler::default(); assert_eq!(sampler.total_weight(), NonNegativeF64::zero()); @@ -432,7 +432,7 @@ fn sample_single_group_full() { tally[sample as usize] += 1; } - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] for (i, c) in tally.iter().enumerate() { let target = (((6 + i) as f64) / 51.0_f64) * 1000.0; let measure = ((*c as f64) / (N as f64)) * 1000.0; @@ -478,7 +478,7 @@ fn sample_three_groups_full() { tally[sample as usize - 1] += 1; } - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] for (i, c) in tally.iter().enumerate() { let target = (((i + 1) as f64) / 21.0_f64) * 1000.0; let measure = ((*c as f64) / (N as f64)) * 1000.0; @@ -520,7 +520,7 @@ fn sample_three_groups_full_reverse() { tally[sample as usize - 1] += 1; } - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] for (i, c) in tally.iter().enumerate() { let target = (((i + 1) as f64) / 21.0_f64) * 1000.0; let measure = ((*c as f64) / (N as f64)) * 1000.0; @@ -576,7 +576,7 @@ impl DummyRng { fn new(mut vec: Vec) -> Self { vec.reverse(); - #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] + #[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)] Self( vec.into_iter() .map(|u01| ((u01 / f64::from_bits(0x3CA0_0000_0000_0000_u64)) as u64) << 11) diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/classical/mod.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/classical/mod.rs index 2bd683d45..377e4703d 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/classical/mod.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/classical/mod.rs @@ -14,7 +14,7 @@ use crate::cogs::{ mod sampler; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct ClassicalActiveLineageSampler< M: MathsCore, @@ -28,7 +28,7 @@ pub struct ClassicalActiveLineageSampler< > { active_lineage_references: Vec, last_event_time: NonNegativeF64, - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] _marker: PhantomData<(M, H, G, S, X, D, N, I)>, } @@ -64,7 +64,7 @@ impl< where H: 'h, { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let capacity = origin_sampler.full_upper_bound_size_hint() as usize; let mut lineage_store = S::with_capacity(origin_sampler.habitat(), capacity); diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/const.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/const.rs index 598721483..6c8f77076 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/const.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/const.rs @@ -6,7 +6,7 @@ use necsim_core_bond::{NonNegativeF64, PositiveF64}; use super::EventTimeSampler; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Clone, Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] pub struct ConstEventTimeSampler { diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/exp.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/exp.rs index 9e7b1207e..974cbf996 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/exp.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/exp.rs @@ -9,7 +9,7 @@ use super::EventTimeSampler; // 2^64 / PHI const INV_PHI: u64 = 0x9e37_79b9_7f4a_7c15_u64; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Clone, Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] pub struct ExpEventTimeSampler { @@ -48,13 +48,12 @@ impl, G: PrimeableRng, T: TurnoverRate> ) }; - #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] + #[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)] let mut time_step = M::floor(time.get() / self.delta_t.get()) as u64; let mut event_time = NonNegativeF64::from(time_step) * self.delta_t; let mut time_slice_end = NonNegativeF64::from(time_step + 1) * self.delta_t; - #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] rng.prime_with_habitat(habitat, indexed_location, time_step); let mut sub_index: u64 = 0; diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/fixed.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/fixed.rs index c6ac3227d..4de7ee7b9 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/fixed.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/fixed.rs @@ -6,7 +6,7 @@ use necsim_core_bond::NonNegativeF64; use super::EventTimeSampler; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Clone, Debug, Default)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] pub struct FixedEventTimeSampler([u8; 0]); @@ -27,8 +27,8 @@ impl, G: PrimeableRng, T: TurnoverRate> let lambda = turnover_rate.get_turnover_rate_at_location(indexed_location.location(), habitat); - #[allow(clippy::cast_possible_truncation)] - #[allow(clippy::cast_sign_loss)] + #[expect(clippy::cast_possible_truncation)] + #[expect(clippy::cast_sign_loss)] let time_step = M::floor(time.get() * lambda.get()) as u64 + 1; rng.prime_with_habitat(habitat, indexed_location, time_step); diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/geometric.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/geometric.rs index 476685396..aac6ad40b 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/geometric.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/geometric.rs @@ -6,7 +6,7 @@ use necsim_core_bond::{NonNegativeF64, PositiveF64}; use super::EventTimeSampler; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Clone, Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] pub struct GeometricEventTimeSampler { @@ -39,8 +39,8 @@ impl, G: PrimeableRng, T: TurnoverRate> .neg_exp::() .one_minus(); - #[allow(clippy::cast_possible_truncation)] - #[allow(clippy::cast_sign_loss)] + #[expect(clippy::cast_possible_truncation)] + #[expect(clippy::cast_sign_loss)] let mut time_step = M::floor(time.get() / self.delta_t.get()) as u64 + 1; loop { diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/mod.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/mod.rs index 19c8f2e58..79fefb88f 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/mod.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/mod.rs @@ -10,8 +10,6 @@ pub mod fixed; pub mod geometric; pub mod poisson; -#[allow(clippy::module_name_repetitions)] -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] #[contract_trait] pub trait EventTimeSampler, G: PrimeableRng, T: TurnoverRate>: Clone + core::fmt::Debug diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/poisson.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/poisson.rs index db7a42683..0a9591253 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/poisson.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/event_time_sampler/poisson.rs @@ -9,7 +9,7 @@ use super::EventTimeSampler; // 2^64 / PHI const INV_PHI: u64 = 0x9e37_79b9_7f4a_7c15_u64; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Clone, Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] pub struct PoissonEventTimeSampler { @@ -41,8 +41,8 @@ impl, G: PrimeableRng, T: TurnoverRate> let lambda_per_step = lambda * self.delta_t; let no_event_probability_per_step = M::exp(-lambda_per_step.get()); - #[allow(clippy::cast_possible_truncation)] - #[allow(clippy::cast_sign_loss)] + #[expect(clippy::cast_possible_truncation)] + #[expect(clippy::cast_sign_loss)] let mut time_step = M::floor(time.get() / self.delta_t.get()) as u64; let (event_time, event_index) = loop { @@ -65,7 +65,7 @@ impl, G: PrimeableRng, T: TurnoverRate> poisson } else { // Fallback in case no_event_probability_per_step underflows - #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] + #[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)] let normal_as_poisson = rng .sample_2d_normal(lambda_per_step.get(), lambda_per_step.sqrt::()) .0 @@ -77,7 +77,6 @@ impl, G: PrimeableRng, T: TurnoverRate> let mut next_event = None; for event_index in 0..number_events_at_time_steps { - #[allow(clippy::cast_precision_loss)] let event_time = (NonNegativeF64::from(time_step) + NonNegativeF64::from(rng.sample_uniform_closed_open())) * self.delta_t; diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/mod.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/mod.rs index eb5243a48..a64711352 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/mod.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/independent/mod.rs @@ -23,7 +23,7 @@ pub mod event_time_sampler; use event_time_sampler::EventTimeSampler; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(free = "M"))] @@ -89,7 +89,7 @@ impl< where H: 'h, { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let capacity = origin_sampler.full_upper_bound_size_hint() as usize; let mut lineages = Vec::with_capacity(capacity); diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/resuming/lineage.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/resuming/lineage.rs index 22c52579e..c6dd947e6 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/resuming/lineage.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/resuming/lineage.rs @@ -2,7 +2,7 @@ use alloc::vec::Vec; use necsim_core::lineage::{GlobalLineageReference, Lineage}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub enum ExceptionalLineage { Coalescence { diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/resuming/mod.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/resuming/mod.rs index 2489c5f62..0c7444704 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/resuming/mod.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/resuming/mod.rs @@ -33,7 +33,7 @@ pub struct RestartFixUpActiveLineageSampler< inner: A, restart_time: PositiveF64, fixable_lineages: Vec, - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] _marker: PhantomData<(M, H, G, S, X, D, C, T, N, E, I)>, } diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/resuming/sampler.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/resuming/sampler.rs index d35fe3613..323ecd5ce 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/resuming/sampler.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/resuming/sampler.rs @@ -136,7 +136,6 @@ impl< Some((fixable_lineage, self.restart_time)) } - #[allow(clippy::no_effect_underscore_binding)] #[debug_ensures( self.number_active_lineages() == old(self.number_active_lineages()) + 1, "adds an active lineage" diff --git a/necsim/impls/no-std/src/cogs/active_lineage_sampler/singular.rs b/necsim/impls/no-std/src/cogs/active_lineage_sampler/singular.rs index f595c9808..2f9a52c24 100644 --- a/necsim/impls/no-std/src/cogs/active_lineage_sampler/singular.rs +++ b/necsim/impls/no-std/src/cogs/active_lineage_sampler/singular.rs @@ -7,7 +7,7 @@ use necsim_core::{ lineage::Lineage, }; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait SingularActiveLineageSampler< M: MathsCore, H: Habitat, diff --git a/necsim/impls/no-std/src/cogs/coalescence_sampler/conditional.rs b/necsim/impls/no-std/src/cogs/coalescence_sampler/conditional.rs index e1109422a..e19b03967 100644 --- a/necsim/impls/no-std/src/cogs/coalescence_sampler/conditional.rs +++ b/necsim/impls/no-std/src/cogs/coalescence_sampler/conditional.rs @@ -12,7 +12,7 @@ use necsim_core_bond::ClosedUnitF64; use super::optional_coalescence; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct ConditionalCoalescenceSampler< M: MathsCore, @@ -62,7 +62,6 @@ impl, S: GloballyCoherentLineageStore> ConditionalCoalescenceSampler { #[must_use] - #[allow(clippy::unused_self)] pub fn sample_coalescence_at_location( &self, location: Location, @@ -73,7 +72,7 @@ impl, S: GloballyCoherentLineageStore> let lineages_at_location = lineage_store.get_local_lineage_references_at_location_unordered(&location, habitat); - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let population = lineages_at_location.len() as u32; let chosen_coalescence_index = @@ -89,7 +88,6 @@ impl, S: GloballyCoherentLineageStore> #[must_use] #[debug_requires(habitat.get_habitat_at_location(location) > 0, "location is habitable")] - #[allow(clippy::unused_self)] pub fn get_coalescence_probability_at_location( &self, location: &Location, @@ -100,7 +98,7 @@ impl, S: GloballyCoherentLineageStore> // If the lineage store includes self, the population must be decremented // to avoid coalescence with the currently active lineage - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] let population = (lineage_store .get_local_lineage_references_at_location_unordered(location, habitat) .len() diff --git a/necsim/impls/no-std/src/cogs/coalescence_sampler/independent.rs b/necsim/impls/no-std/src/cogs/coalescence_sampler/independent.rs index 3c417d07f..6d81be089 100644 --- a/necsim/impls/no-std/src/cogs/coalescence_sampler/independent.rs +++ b/necsim/impls/no-std/src/cogs/coalescence_sampler/independent.rs @@ -11,7 +11,7 @@ use crate::cogs::lineage_store::{ independent::IndependentLineageStore, }; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(free = "M", free = "H"))] diff --git a/necsim/impls/no-std/src/cogs/coalescence_sampler/unconditional.rs b/necsim/impls/no-std/src/cogs/coalescence_sampler/unconditional.rs index f7a17bc6a..d77c59159 100644 --- a/necsim/impls/no-std/src/cogs/coalescence_sampler/unconditional.rs +++ b/necsim/impls/no-std/src/cogs/coalescence_sampler/unconditional.rs @@ -11,7 +11,7 @@ use necsim_core::{ use super::optional_coalescence; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct UnconditionalCoalescenceSampler< M: MathsCore, diff --git a/necsim/impls/no-std/src/cogs/dispersal_sampler/almost_infinite/clark2dt.rs b/necsim/impls/no-std/src/cogs/dispersal_sampler/almost_infinite/clark2dt.rs index 1d69eadac..f5d4cd8d8 100644 --- a/necsim/impls/no-std/src/cogs/dispersal_sampler/almost_infinite/clark2dt.rs +++ b/necsim/impls/no-std/src/cogs/dispersal_sampler/almost_infinite/clark2dt.rs @@ -8,7 +8,6 @@ use necsim_core_bond::{ClosedUnitF64, NonNegativeF64, PositiveF64}; use crate::cogs::habitat::almost_infinite::AlmostInfiniteHabitat; -#[allow(clippy::module_name_repetitions)] #[derive(Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(free = "M", free = "G"))] @@ -26,7 +25,7 @@ impl> AlmostInfiniteClark2DtDispersalSampler { // For now, we numerically integrate the self-dispersal probability // using polar coordinates - #[allow(clippy::useless_conversion)] // prepare for new range iterators + #[expect(clippy::useless_conversion)] // prepare for new range iterators let self_dispersal = (0..N) .into_iter() .map(|i| { @@ -132,7 +131,7 @@ impl> SeparableDispersalSampler(x: f64, exp: f64) -> f64 { - #[allow(clippy::float_cmp)] + #[expect(clippy::float_cmp)] if exp == 1.0 { return x; } @@ -263,7 +262,7 @@ mod tests { } #[test] - #[allow(clippy::too_many_lines)] + #[expect(clippy::too_many_lines)] fn test_cdf() { assert_eq_bits!( cdf::( @@ -559,7 +558,7 @@ mod tests { } #[test] - #[allow(clippy::too_many_lines)] + #[expect(clippy::too_many_lines)] fn test_cdf_inverse() { assert_eq_bits!( cdf_inverse::( diff --git a/necsim/impls/no-std/src/cogs/dispersal_sampler/almost_infinite/downscaled.rs b/necsim/impls/no-std/src/cogs/dispersal_sampler/almost_infinite/downscaled.rs index e2caec92d..ba2ae7aaa 100644 --- a/necsim/impls/no-std/src/cogs/dispersal_sampler/almost_infinite/downscaled.rs +++ b/necsim/impls/no-std/src/cogs/dispersal_sampler/almost_infinite/downscaled.rs @@ -15,7 +15,6 @@ use crate::{ }, }; -#[allow(clippy::module_name_repetitions)] #[derive(Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(free = "M", free = "G"))] @@ -27,7 +26,6 @@ pub struct AlmostInfiniteDownscaledDispersalSampler< #[cfg_attr(feature = "cuda", cuda(embed))] dispersal: D, self_dispersal: ClosedUnitF64, - #[allow(clippy::type_complexity)] #[cfg_attr(feature = "cuda", cuda(embed))] non_self_dispersal: Option]>>, marker: PhantomData<(M, G)>, diff --git a/necsim/impls/no-std/src/cogs/dispersal_sampler/almost_infinite/normal.rs b/necsim/impls/no-std/src/cogs/dispersal_sampler/almost_infinite/normal.rs index ecd9fb2d0..78c23f119 100644 --- a/necsim/impls/no-std/src/cogs/dispersal_sampler/almost_infinite/normal.rs +++ b/necsim/impls/no-std/src/cogs/dispersal_sampler/almost_infinite/normal.rs @@ -8,7 +8,6 @@ use necsim_core_bond::{ClosedUnitF64, NonNegativeF64}; use crate::cogs::habitat::almost_infinite::AlmostInfiniteHabitat; -#[allow(clippy::module_name_repetitions)] #[derive(Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(free = "M", free = "G"))] diff --git a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/alias/dispersal.rs b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/alias/dispersal.rs index 6977cdb69..853ef37ec 100644 --- a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/alias/dispersal.rs +++ b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/alias/dispersal.rs @@ -25,7 +25,7 @@ impl, G: RngCore> DispersalSampler let dispersal_target_index = alias_dispersal_at_location.sample_event(rng); - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] Location::new( habitat.get_extent().origin().x().wrapping_add( (dispersal_target_index % usize::from(habitat.get_extent().width())) as u32, diff --git a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/alias/mod.rs b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/alias/mod.rs index 513bbe6ea..55ed23d53 100644 --- a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/alias/mod.rs +++ b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/alias/mod.rs @@ -18,7 +18,6 @@ use super::{contract::check_in_memory_dispersal_contract, InMemoryDispersalSampl mod dispersal; -#[allow(clippy::module_name_repetitions)] #[derive(Debug)] pub struct InMemoryAliasDispersalSampler, G: RngCore> { alias_dispersal: ArcArray2D>>, @@ -44,7 +43,7 @@ impl, G: RngCore> InMemoryDispersalSampler>( dispersal: &Array2D, habitat: &H, @@ -25,7 +25,7 @@ pub fn check_in_memory_dispersal_contract>( let habitat_width = habitat_extent.width(); for row_index in 0..dispersal.num_rows() { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let dispersal_origin = Location::new( (row_index % usize::from(habitat_width)) as u32, (row_index / usize::from(habitat_width)) as u32, @@ -35,7 +35,7 @@ pub fn check_in_memory_dispersal_contract>( let mut any_dispersal = false; for col_index in 0..dispersal.num_columns() { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let dispersal_target = Location::new( (col_index % usize::from(habitat_width)) as u32, (col_index / usize::from(habitat_width)) as u32, diff --git a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/cumulative/contract.rs b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/cumulative/contract.rs index d2fcdf2de..cf025e2c4 100644 --- a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/cumulative/contract.rs +++ b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/cumulative/contract.rs @@ -10,7 +10,7 @@ impl, G: RngCore> InMemoryCumulativeDispersalSamp let habitat_width = habitat.get_extent().width(); for target_index in self.valid_dispersal_targets.iter().filter_map(|x| *x) { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let dispersal_target = Location::new( (target_index % usize::from(habitat_width)) as u32, (target_index / usize::from(habitat_width)) as u32, diff --git a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/cumulative/dispersal.rs b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/cumulative/dispersal.rs index 59103a7eb..efeecbc64 100644 --- a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/cumulative/dispersal.rs +++ b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/cumulative/dispersal.rs @@ -49,7 +49,7 @@ impl, G: RngCore> DispersalSampler unreachable!("habitat dispersal origin must disperse somewhere") }; - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] Location::new( habitat.get_extent().origin().x().wrapping_add( (valid_dispersal_target_index % usize::from(habitat.get_extent().width())) as u32, diff --git a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/cumulative/mod.rs b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/cumulative/mod.rs index 54d2e2ab2..a790da18b 100644 --- a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/cumulative/mod.rs +++ b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/cumulative/mod.rs @@ -15,7 +15,6 @@ use super::{contract::check_in_memory_dispersal_contract, InMemoryDispersalSampl mod contract; mod dispersal; -#[allow(clippy::module_name_repetitions)] #[derive(Debug)] pub struct InMemoryCumulativeDispersalSampler, G: RngCore> { cumulative_dispersal: Arc<[ClosedUnitF64]>, @@ -26,7 +25,6 @@ pub struct InMemoryCumulativeDispersalSampler, G: Rn impl, G: RngCore> InMemoryDispersalSampler for InMemoryCumulativeDispersalSampler { - #[allow(clippy::no_effect_underscore_binding)] #[debug_ensures(ret.as_ref().map_or(true, |ret| { ret.explicit_only_valid_targets_dispersal_contract(old(habitat)) }), "valid_dispersal_targets only allows dispersal to habitat")] @@ -46,7 +44,7 @@ impl, G: RngCore> InMemoryDispersalSampler, G: RngCore> InMemoryDispersalSampler = None; for col_index in 0..dispersal.num_columns() { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let location = Location::new( habitat_extent.origin().x().wrapping_add( diff --git a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/mod.rs b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/mod.rs index 333c4fd8b..86022dccf 100644 --- a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/mod.rs +++ b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/mod.rs @@ -13,7 +13,7 @@ pub mod packed_alias; pub mod packed_separable_alias; pub mod separable_alias; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait InMemoryDispersalSampler, G: RngCore>: DispersalSampler + Sized { @@ -40,7 +40,7 @@ pub trait InMemoryDispersalSampler, G: RngCore>: ) -> Result; } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, displaydoc::Display)] pub enum InMemoryDispersalSamplerError { /** The size of the dispersal map is inconsistent with the size of the diff --git a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/packed_alias/dispersal.rs b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/packed_alias/dispersal.rs index f8c3e0697..e8b74d353 100644 --- a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/packed_alias/dispersal.rs +++ b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/packed_alias/dispersal.rs @@ -40,7 +40,7 @@ impl, G: RngCore> DispersalSampler let dispersal_target_index: usize = AliasMethodSamplerAtom::sample_event(alias_dispersals_at_location, rng); - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] Location::new( habitat.get_extent().origin().x().wrapping_add( (dispersal_target_index % usize::from(habitat.get_extent().width())) as u32, diff --git a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/packed_alias/mod.rs b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/packed_alias/mod.rs index 814a4f096..bc9414404 100644 --- a/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/packed_alias/mod.rs +++ b/necsim/impls/no-std/src/cogs/dispersal_sampler/in_memory/packed_alias/mod.rs @@ -20,7 +20,6 @@ use super::{ }; #[derive(Clone, Debug, TypeLayout)] -#[allow(clippy::module_name_repetitions)] #[doc(hidden)] #[repr(C)] pub struct AliasSamplerRange { @@ -43,7 +42,6 @@ impl From for Range { } } -#[allow(clippy::module_name_repetitions)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(free = "M", free = "H", free = "G"))] pub struct InMemoryPackedAliasDispersalSampler, G: RngCore> { @@ -75,7 +73,7 @@ impl, G: RngCore> InMemoryDispersalSampler, G: RngCore> DispersalSampler self_dispersal_index }; - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] Location::new( habitat.get_extent().origin().x().wrapping_add( (dispersal_target_index % usize::from(habitat.get_extent().width())) as u32, @@ -133,7 +133,7 @@ impl, G: RngCore> SeparableDispersalSampler, G: RngCore> @@ -60,7 +57,7 @@ pub struct InMemoryPackedSeparableAliasDispersalSampler, G: RngCore> InMemoryDispersalSampler for InMemoryPackedSeparableAliasDispersalSampler { - #[allow(clippy::too_many_lines)] + #[expect(clippy::too_many_lines)] fn new( dispersal: &Array2D, habitat: &H, @@ -92,7 +89,7 @@ impl, G: RngCore> InMemoryDispersalSampler, G: RngCore> SeparableDispersalSampler, G: RngCore> { alias_dispersal: ArcArray2D>>, @@ -53,7 +52,7 @@ impl, G: RngCore> InMemoryDispersalSampler> DispersalSampler, G> let dispersal_target_index = rng.sample_index_u64(habitat.get_extent().area()); - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] Location::new( habitat .get_extent() @@ -98,7 +98,7 @@ impl> SeparableDispersalSampler, G: RngCore>: Backup + core::fmt::Debug @@ -26,7 +23,7 @@ pub trait AntiTrespassingDispersalSampler, G: RngCor ) -> Location; } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(free = "M"))] @@ -90,7 +87,6 @@ impl< { #[must_use] #[inline] - #[allow(clippy::no_effect_underscore_binding)] #[debug_ensures(old(habitat).is_location_habitable(&ret), "target is habitable")] fn sample_dispersal_from_location( &self, @@ -133,7 +129,6 @@ impl< { #[must_use] #[inline] - #[allow(clippy::no_effect_underscore_binding)] #[debug_ensures(old(habitat).is_location_habitable(&ret), "target is habitable")] #[debug_ensures(&ret != location, "disperses to a different location")] fn sample_non_self_dispersal_from_location( diff --git a/necsim/impls/no-std/src/cogs/dispersal_sampler/trespassing/uniform.rs b/necsim/impls/no-std/src/cogs/dispersal_sampler/trespassing/uniform.rs index 26bef8225..6ae1e1d76 100644 --- a/necsim/impls/no-std/src/cogs/dispersal_sampler/trespassing/uniform.rs +++ b/necsim/impls/no-std/src/cogs/dispersal_sampler/trespassing/uniform.rs @@ -7,7 +7,7 @@ use necsim_core::{ use super::AntiTrespassingDispersalSampler; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(free = "M", free = "H", free = "G"))] diff --git a/necsim/impls/no-std/src/cogs/dispersal_sampler/wrapping_noise.rs b/necsim/impls/no-std/src/cogs/dispersal_sampler/wrapping_noise.rs index d6675295c..c7dcba6a9 100644 --- a/necsim/impls/no-std/src/cogs/dispersal_sampler/wrapping_noise.rs +++ b/necsim/impls/no-std/src/cogs/dispersal_sampler/wrapping_noise.rs @@ -9,7 +9,7 @@ use crate::cogs::{ habitat::wrapping_noise::WrappingNoiseHabitat, }; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(free = "M"))] diff --git a/necsim/impls/no-std/src/cogs/emigration_exit/domain.rs b/necsim/impls/no-std/src/cogs/emigration_exit/domain.rs index dca13451b..263d68618 100644 --- a/necsim/impls/no-std/src/cogs/emigration_exit/domain.rs +++ b/necsim/impls/no-std/src/cogs/emigration_exit/domain.rs @@ -15,7 +15,7 @@ use necsim_core::{ use crate::decomposition::Decomposition; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct DomainEmigrationExit, C: Decomposition> { decomposition: C, diff --git a/necsim/impls/no-std/src/cogs/emigration_exit/independent/choice/always.rs b/necsim/impls/no-std/src/cogs/emigration_exit/independent/choice/always.rs index ffba660b1..72232fa08 100644 --- a/necsim/impls/no-std/src/cogs/emigration_exit/independent/choice/always.rs +++ b/necsim/impls/no-std/src/cogs/emigration_exit/independent/choice/always.rs @@ -6,7 +6,7 @@ use necsim_core_bond::PositiveF64; use super::EmigrationChoice; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, Default)] pub struct AlwaysEmigrationChoice([u8; 0]); diff --git a/necsim/impls/no-std/src/cogs/emigration_exit/independent/choice/mod.rs b/necsim/impls/no-std/src/cogs/emigration_exit/independent/choice/mod.rs index 2705041ff..308ae37fa 100644 --- a/necsim/impls/no-std/src/cogs/emigration_exit/independent/choice/mod.rs +++ b/necsim/impls/no-std/src/cogs/emigration_exit/independent/choice/mod.rs @@ -7,8 +7,7 @@ use necsim_core_bond::PositiveF64; pub mod always; pub mod probabilistic; -#[allow(clippy::module_name_repetitions)] -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] +#[expect(clippy::module_name_repetitions)] #[contract_trait] pub trait EmigrationChoice>: Backup + core::fmt::Debug { fn should_lineage_emigrate( diff --git a/necsim/impls/no-std/src/cogs/emigration_exit/independent/choice/probabilistic.rs b/necsim/impls/no-std/src/cogs/emigration_exit/independent/choice/probabilistic.rs index d8c8bbdc1..7bdd51293 100644 --- a/necsim/impls/no-std/src/cogs/emigration_exit/independent/choice/probabilistic.rs +++ b/necsim/impls/no-std/src/cogs/emigration_exit/independent/choice/probabilistic.rs @@ -6,7 +6,7 @@ use necsim_core_bond::{ClosedUnitF64, PositiveF64}; use super::EmigrationChoice; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct ProbabilisticEmigrationChoice { probability: ClosedUnitF64, @@ -39,7 +39,7 @@ impl> EmigrationChoice for ProbabilisticEmigra let hash = diffuse(time.get().to_bits()); // http://prng.di.unimi.it -> Generating uniform doubles in the unit interval - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] let u01 = ((hash >> 11) as f64) * f64::from_bits(0x3CA0_0000_0000_0000_u64); // 0x1.0p-53 u01 <= self.probability.get() diff --git a/necsim/impls/no-std/src/cogs/emigration_exit/independent/mod.rs b/necsim/impls/no-std/src/cogs/emigration_exit/independent/mod.rs index 5720aca3a..f1e1472a1 100644 --- a/necsim/impls/no-std/src/cogs/emigration_exit/independent/mod.rs +++ b/necsim/impls/no-std/src/cogs/emigration_exit/independent/mod.rs @@ -18,7 +18,7 @@ use crate::{ pub mod choice; use choice::EmigrationChoice; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct IndependentEmigrationExit< M: MathsCore, diff --git a/necsim/impls/no-std/src/cogs/emigration_exit/never.rs b/necsim/impls/no-std/src/cogs/emigration_exit/never.rs index 62e5320a5..c8be62fe3 100644 --- a/necsim/impls/no-std/src/cogs/emigration_exit/never.rs +++ b/necsim/impls/no-std/src/cogs/emigration_exit/never.rs @@ -6,7 +6,7 @@ use necsim_core::{ }; use necsim_core_bond::{NonNegativeF64, PositiveF64}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, Default)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] pub struct NeverEmigrationExit([u8; 0]); diff --git a/necsim/impls/no-std/src/cogs/event_sampler/gillespie/conditional/mod.rs b/necsim/impls/no-std/src/cogs/event_sampler/gillespie/conditional/mod.rs index 2775ad348..5c4853968 100644 --- a/necsim/impls/no-std/src/cogs/event_sampler/gillespie/conditional/mod.rs +++ b/necsim/impls/no-std/src/cogs/event_sampler/gillespie/conditional/mod.rs @@ -23,7 +23,7 @@ mod probability; use probability::ProbabilityAtLocation; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct ConditionalGillespieEventSampler< M: MathsCore, @@ -35,7 +35,7 @@ pub struct ConditionalGillespieEventSampler< T: TurnoverRate, N: SpeciationProbability, > { - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] marker: PhantomData<(M, H, G, S, X, D, T, N)>, } diff --git a/necsim/impls/no-std/src/cogs/event_sampler/gillespie/conditional/probability.rs b/necsim/impls/no-std/src/cogs/event_sampler/gillespie/conditional/probability.rs index 8d7ccaba2..05715c2ed 100644 --- a/necsim/impls/no-std/src/cogs/event_sampler/gillespie/conditional/probability.rs +++ b/necsim/impls/no-std/src/cogs/event_sampler/gillespie/conditional/probability.rs @@ -9,7 +9,7 @@ use necsim_core_bond::ClosedUnitF64; use crate::cogs::coalescence_sampler::conditional::ConditionalCoalescenceSampler; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct ProbabilityAtLocation { speciation: ClosedUnitF64, out_dispersal: ClosedUnitF64, diff --git a/necsim/impls/no-std/src/cogs/event_sampler/gillespie/mod.rs b/necsim/impls/no-std/src/cogs/event_sampler/gillespie/mod.rs index f0c8b72cb..9255ae548 100644 --- a/necsim/impls/no-std/src/cogs/event_sampler/gillespie/mod.rs +++ b/necsim/impls/no-std/src/cogs/event_sampler/gillespie/mod.rs @@ -10,9 +10,8 @@ use necsim_core_bond::NonNegativeF64; pub mod conditional; pub mod unconditional; -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] #[contract_trait] -#[allow(clippy::module_name_repetitions, clippy::too_many_arguments)] +#[expect(clippy::module_name_repetitions, clippy::too_many_arguments)] pub trait GillespieEventSampler< M: MathsCore, H: Habitat, diff --git a/necsim/impls/no-std/src/cogs/event_sampler/gillespie/unconditional.rs b/necsim/impls/no-std/src/cogs/event_sampler/gillespie/unconditional.rs index b1864186d..564176033 100644 --- a/necsim/impls/no-std/src/cogs/event_sampler/gillespie/unconditional.rs +++ b/necsim/impls/no-std/src/cogs/event_sampler/gillespie/unconditional.rs @@ -16,7 +16,7 @@ use necsim_core_bond::{NonNegativeF64, PositiveF64}; use super::GillespieEventSampler; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct UnconditionalGillespieEventSampler< M: MathsCore, @@ -29,7 +29,7 @@ pub struct UnconditionalGillespieEventSampler< T: TurnoverRate, N: SpeciationProbability, > { - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] marker: PhantomData<(M, H, G, S, X, D, C, T, N)>, } diff --git a/necsim/impls/no-std/src/cogs/event_sampler/independent.rs b/necsim/impls/no-std/src/cogs/event_sampler/independent.rs index 17ac313d0..73178a4a8 100644 --- a/necsim/impls/no-std/src/cogs/event_sampler/independent.rs +++ b/necsim/impls/no-std/src/cogs/event_sampler/independent.rs @@ -19,7 +19,7 @@ use crate::cogs::{ use super::tracking::{MinSpeciationTrackingEventSampler, SpeciationSample}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr( diff --git a/necsim/impls/no-std/src/cogs/event_sampler/unconditional.rs b/necsim/impls/no-std/src/cogs/event_sampler/unconditional.rs index b20c476e7..3a245a083 100644 --- a/necsim/impls/no-std/src/cogs/event_sampler/unconditional.rs +++ b/necsim/impls/no-std/src/cogs/event_sampler/unconditional.rs @@ -12,7 +12,7 @@ use necsim_core::{ }; use necsim_core_bond::PositiveF64; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct UnconditionalEventSampler< M: MathsCore, @@ -25,7 +25,7 @@ pub struct UnconditionalEventSampler< T: TurnoverRate, N: SpeciationProbability, > { - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] marker: PhantomData<(M, H, G, S, X, D, C, T, N)>, } diff --git a/necsim/impls/no-std/src/cogs/habitat/almost_infinite/downscaled.rs b/necsim/impls/no-std/src/cogs/habitat/almost_infinite/downscaled.rs index e2a34fbbb..77bc22638 100644 --- a/necsim/impls/no-std/src/cogs/habitat/almost_infinite/downscaled.rs +++ b/necsim/impls/no-std/src/cogs/habitat/almost_infinite/downscaled.rs @@ -9,7 +9,6 @@ use super::AlmostInfiniteHabitat; const ALMOST_INFINITE_EXTENT: LandscapeExtent = LandscapeExtent::new(Location::new(0, 0), OffByOneU32::max(), OffByOneU32::max()); -#[allow(clippy::module_name_repetitions)] #[derive(Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(free = "M"))] diff --git a/necsim/impls/no-std/src/cogs/habitat/almost_infinite/mod.rs b/necsim/impls/no-std/src/cogs/habitat/almost_infinite/mod.rs index dcc588823..0fae40e70 100644 --- a/necsim/impls/no-std/src/cogs/habitat/almost_infinite/mod.rs +++ b/necsim/impls/no-std/src/cogs/habitat/almost_infinite/mod.rs @@ -13,7 +13,7 @@ pub mod downscaled; const ALMOST_INFINITE_EXTENT: LandscapeExtent = LandscapeExtent::new(Location::new(0, 0), OffByOneU32::max(), OffByOneU32::max()); -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(free = "M"))] pub struct AlmostInfiniteHabitat { @@ -105,13 +105,13 @@ impl AlmostInfiniteHabitat { // Discrete dispersal assumes lineage positions are centred on (0.5, 0.5), // i.e. |dispersal| >= 0.5 changes the cell // (dx and dy must be rounded to nearest int away from 0.0) - #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] + #[expect(clippy::cast_possible_truncation)] let (dx, dy): (i64, i64) = (M::round(dx) as i64, M::round(dy) as i64); let new_x = (i64::from(location.x()) + dx) % WRAP; let new_y = (i64::from(location.y()) + dy) % WRAP; - #[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)] + #[expect(clippy::cast_sign_loss, clippy::cast_possible_truncation)] Location::new( ((new_x + WRAP) % WRAP) as u32, ((new_y + WRAP) % WRAP) as u32, diff --git a/necsim/impls/no-std/src/cogs/habitat/in_memory.rs b/necsim/impls/no-std/src/cogs/habitat/in_memory.rs index 9c215bd1f..b00364df5 100644 --- a/necsim/impls/no-std/src/cogs/habitat/in_memory.rs +++ b/necsim/impls/no-std/src/cogs/habitat/in_memory.rs @@ -10,7 +10,7 @@ use necsim_core_bond::{OffByOneU32, OffByOneU64}; use crate::array2d::Array2D; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(free = "M"))] @@ -87,7 +87,7 @@ impl Habitat for InMemoryHabitat { .enumerate() .filter_map(move |(location_index, habitat)| { if *habitat > 0 { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] Some(Location::new( self.extent.origin().x().wrapping_add( (location_index % usize::from(self.extent.width())) as u32, @@ -117,7 +117,7 @@ impl> UniformlySampleableHabitat for InMemoryH Err(index) => index - 1, }; - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] IndexedLocation::new( Location::new( self.extent @@ -167,7 +167,6 @@ impl InMemoryHabitat { return None; } - #[allow(clippy::cast_possible_truncation)] let extent = LandscapeExtent::new(Location::new(0, 0), width, height); Some(Self { diff --git a/necsim/impls/no-std/src/cogs/habitat/non_spatial.rs b/necsim/impls/no-std/src/cogs/habitat/non_spatial.rs index 969978871..11a6784b9 100644 --- a/necsim/impls/no-std/src/cogs/habitat/non_spatial.rs +++ b/necsim/impls/no-std/src/cogs/habitat/non_spatial.rs @@ -6,7 +6,7 @@ use necsim_core::{ }; use necsim_core_bond::{OffByOneU32, OffByOneU64}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(free = "M"))] @@ -119,11 +119,11 @@ impl> UniformlySampleableHabitat for NonSpatia use necsim_core::cogs::RngSampler; let mut dispersal_target_index = rng.sample_index_u64(self.get_total_habitat()); - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let index = (dispersal_target_index % u64::from(self.deme.get())) as u32; dispersal_target_index /= u64::from(self.deme.get()); - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] IndexedLocation::new( Location::new( self.extent diff --git a/necsim/impls/no-std/src/cogs/habitat/spatially_implicit.rs b/necsim/impls/no-std/src/cogs/habitat/spatially_implicit.rs index 390176c2d..3d55b4264 100644 --- a/necsim/impls/no-std/src/cogs/habitat/spatially_implicit.rs +++ b/necsim/impls/no-std/src/cogs/habitat/spatially_implicit.rs @@ -11,7 +11,7 @@ use crate::cogs::habitat::non_spatial::NonSpatialHabitat; const SPATIALLY_IMPLICIT_EXTENT: LandscapeExtent = LandscapeExtent::new(Location::new(0, 0), OffByOneU32::max(), OffByOneU32::max()); -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(free = "M"))] diff --git a/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/mod.rs b/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/mod.rs index 5e4f1bd3f..696ebe5bd 100644 --- a/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/mod.rs +++ b/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/mod.rs @@ -16,7 +16,7 @@ use crate::cogs::{ lineage_store::coherent::globally::singleton_demes::SingletonDemesHabitat, rng::wyhash::WyHash, }; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(free = "M"))] pub struct WrappingNoiseHabitat { @@ -78,9 +78,9 @@ impl WrappingNoiseHabitat { samples.sort_unstable_by(f64::total_cmp); - #[allow(clippy::cast_possible_truncation)] - #[allow(clippy::cast_sign_loss)] - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_possible_truncation)] + #[expect(clippy::cast_sign_loss)] + #[expect(clippy::cast_precision_loss)] let threshold = samples [(M::floor((samples.len() as f64) * coverage.get()) as usize).min(samples.len() - 1)]; diff --git a/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/opensimplex_noise/mod.rs b/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/opensimplex_noise/mod.rs index d19a1a75d..62b50c7ca 100644 --- a/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/opensimplex_noise/mod.rs +++ b/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/opensimplex_noise/mod.rs @@ -47,19 +47,16 @@ impl OpenSimplexNoise { } } - #[allow(dead_code)] #[must_use] pub fn eval_2d(&self, x: f64, y: f64, wrap: f64) -> f64 { OpenSimplexNoise2D::eval::(Vec2::new(x, y), &self.perm, wrap) } - #[allow(dead_code)] #[must_use] pub fn eval_3d(&self, x: f64, y: f64, z: f64, wrap: f64) -> f64 { OpenSimplexNoise3D::eval::(Vec3::new(x, y, z), &self.perm, wrap) } - #[allow(dead_code)] #[must_use] pub fn eval_4d(&self, x: f64, y: f64, z: f64, w: f64, wrap: f64) -> f64 { OpenSimplexNoise4D::eval::(Vec4::new(x, y, z, w), &self.perm, wrap) diff --git a/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/opensimplex_noise/open_simplex_noise_4d.rs b/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/opensimplex_noise/open_simplex_noise_4d.rs index fb330f108..30f8af920 100644 --- a/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/opensimplex_noise/open_simplex_noise_4d.rs +++ b/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/opensimplex_noise/open_simplex_noise_4d.rs @@ -312,7 +312,7 @@ impl OpenSimplexNoise4D { + contribute(1.0, 1.0, 1.0, 1.0) } - #[allow(clippy::too_many_lines)] + #[expect(clippy::too_many_lines)] fn inside_second_dispentachoron( ins: Vec4, contribute: impl Fn(f64, f64, f64, f64) -> f64, @@ -492,7 +492,7 @@ impl OpenSimplexNoise4D { + contribute(0.0, 0.0, 1.0, 1.0) } - #[allow(clippy::too_many_lines)] + #[expect(clippy::too_many_lines)] fn inside_first_dispentachoron( ins: Vec4, contribute: impl Fn(f64, f64, f64, f64) -> f64, diff --git a/necsim/impls/no-std/src/cogs/immigration_entry/buffered.rs b/necsim/impls/no-std/src/cogs/immigration_entry/buffered.rs index ecf95e6e1..37c162c91 100644 --- a/necsim/impls/no-std/src/cogs/immigration_entry/buffered.rs +++ b/necsim/impls/no-std/src/cogs/immigration_entry/buffered.rs @@ -6,7 +6,7 @@ use necsim_core::{ lineage::MigratingLineage, }; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, Default)] pub struct BufferedImmigrationEntry { immigrants: BinaryHeap>, diff --git a/necsim/impls/no-std/src/cogs/immigration_entry/never.rs b/necsim/impls/no-std/src/cogs/immigration_entry/never.rs index 9c4df3ac8..be0904b35 100644 --- a/necsim/impls/no-std/src/cogs/immigration_entry/never.rs +++ b/necsim/impls/no-std/src/cogs/immigration_entry/never.rs @@ -3,7 +3,7 @@ use necsim_core::{ lineage::MigratingLineage, }; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, Default)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] pub struct NeverImmigrationEntry([u8; 0]); diff --git a/necsim/impls/no-std/src/cogs/lineage_reference/in_memory.rs b/necsim/impls/no-std/src/cogs/lineage_reference/in_memory.rs index cc7672a35..d8e095b49 100644 --- a/necsim/impls/no-std/src/cogs/lineage_reference/in_memory.rs +++ b/necsim/impls/no-std/src/cogs/lineage_reference/in_memory.rs @@ -3,7 +3,7 @@ use core::hash::Hash; use necsim_core::cogs::{Backup, Habitat, LineageReference, MathsCore}; #[derive(PartialEq, Eq, Hash, Debug, TypeLayout)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[repr(transparent)] pub struct InMemoryLineageReference(usize); diff --git a/necsim/impls/no-std/src/cogs/lineage_store/coherent/globally/gillespie/mod.rs b/necsim/impls/no-std/src/cogs/lineage_store/coherent/globally/gillespie/mod.rs index 95dee3b23..684033f16 100644 --- a/necsim/impls/no-std/src/cogs/lineage_store/coherent/globally/gillespie/mod.rs +++ b/necsim/impls/no-std/src/cogs/lineage_store/coherent/globally/gillespie/mod.rs @@ -16,7 +16,7 @@ use crate::cogs::lineage_reference::in_memory::InMemoryLineageReference; mod store; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct GillespieLineageStore> { lineages_store: Slab, diff --git a/necsim/impls/no-std/src/cogs/lineage_store/coherent/globally/singleton_demes/mod.rs b/necsim/impls/no-std/src/cogs/lineage_store/coherent/globally/singleton_demes/mod.rs index 64fb4bfdb..2ae74b974 100644 --- a/necsim/impls/no-std/src/cogs/lineage_store/coherent/globally/singleton_demes/mod.rs +++ b/necsim/impls/no-std/src/cogs/lineage_store/coherent/globally/singleton_demes/mod.rs @@ -16,7 +16,7 @@ mod store; /// Marker trait which declares that all locations have <= 1 habitat /// i.e. all indexed locations have index 0 -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait SingletonDemesHabitat: Habitat { #[must_use] #[inline] @@ -27,7 +27,7 @@ pub trait SingletonDemesHabitat: Habitat { } } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct SingletonDemesLineageStore> { lineages_store: Slab, diff --git a/necsim/impls/no-std/src/cogs/lineage_store/coherent/locally/classical/mod.rs b/necsim/impls/no-std/src/cogs/lineage_store/coherent/locally/classical/mod.rs index bae6895ac..ece0e7dba 100644 --- a/necsim/impls/no-std/src/cogs/lineage_store/coherent/locally/classical/mod.rs +++ b/necsim/impls/no-std/src/cogs/lineage_store/coherent/locally/classical/mod.rs @@ -14,7 +14,7 @@ use crate::cogs::lineage_reference::in_memory::InMemoryLineageReference; mod store; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct ClassicalLineageStore> { lineages_store: Slab, diff --git a/necsim/impls/no-std/src/cogs/lineage_store/independent.rs b/necsim/impls/no-std/src/cogs/lineage_store/independent.rs index 606be853e..b3d279f23 100644 --- a/necsim/impls/no-std/src/cogs/lineage_store/independent.rs +++ b/necsim/impls/no-std/src/cogs/lineage_store/independent.rs @@ -5,7 +5,7 @@ use necsim_core::{ lineage::{GlobalLineageReference, Lineage}, }; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] #[cfg_attr(feature = "cuda", cuda(free = "M", free = "H"))] diff --git a/necsim/impls/no-std/src/cogs/maths/intrinsics.rs b/necsim/impls/no-std/src/cogs/maths/intrinsics.rs index 46801aac8..77f323649 100644 --- a/necsim/impls/no-std/src/cogs/maths/intrinsics.rs +++ b/necsim/impls/no-std/src/cogs/maths/intrinsics.rs @@ -1,2 +1,2 @@ -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub use necsim_core_maths::IntrinsicsMathsCore; diff --git a/necsim/impls/no-std/src/cogs/maths/reproducible.rs b/necsim/impls/no-std/src/cogs/maths/reproducible.rs index 30aad861a..ea1c1a89f 100644 --- a/necsim/impls/no-std/src/cogs/maths/reproducible.rs +++ b/necsim/impls/no-std/src/cogs/maths/reproducible.rs @@ -1,7 +1,7 @@ use necsim_core::cogs::MathsCore; #[derive(Clone, Debug)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub enum ReproducibleMathsCore {} impl MathsCore for ReproducibleMathsCore { diff --git a/necsim/impls/no-std/src/cogs/origin_sampler/decomposition.rs b/necsim/impls/no-std/src/cogs/origin_sampler/decomposition.rs index 518e26a61..7dbdeef33 100644 --- a/necsim/impls/no-std/src/cogs/origin_sampler/decomposition.rs +++ b/necsim/impls/no-std/src/cogs/origin_sampler/decomposition.rs @@ -12,7 +12,7 @@ use crate::{ decomposition::Decomposition, }; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct DecompositionOriginSampler< 'd, @@ -54,7 +54,7 @@ impl<'d, M: MathsCore, O: UntrustedOriginSampler<'d, M>, D: Decomposition u64 { - #[allow( + #[expect( clippy::cast_possible_truncation, clippy::cast_sign_loss, clippy::cast_precision_loss @@ -77,7 +77,6 @@ impl<'d, M: MathsCore, O: UntrustedOriginSampler<'d, M>, D: Decomposition Option { - #[allow(clippy::while_let_on_iterator)] while let Some(lineage) = self.origin_sampler.next() { // Forward any out-of-habitat or out-of-deme lineages // (but only on the root subdomain -> no duplication) diff --git a/necsim/impls/no-std/src/cogs/origin_sampler/in_memory.rs b/necsim/impls/no-std/src/cogs/origin_sampler/in_memory.rs index 4ea417586..285bc3fd7 100644 --- a/necsim/impls/no-std/src/cogs/origin_sampler/in_memory.rs +++ b/necsim/impls/no-std/src/cogs/origin_sampler/in_memory.rs @@ -16,7 +16,7 @@ use crate::cogs::{ use super::{TrustedOriginSampler, UntrustedOriginSampler}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct InMemoryOriginSampler<'h, M: MathsCore, I: Iterator> { pre_sampler: OriginPreSampler, last_index: u64, @@ -66,11 +66,7 @@ impl<'h, M: MathsCore, I: Iterator> UntrustedOriginSampler<'h, M> } fn full_upper_bound_size_hint(&self) -> u64 { - #[allow( - clippy::cast_possible_truncation, - clippy::cast_sign_loss, - clippy::cast_precision_loss - )] + #[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)] { (f64::from(self.habitat.get_total_habitat()) * self.pre_sampler.get_sample_proportion().get()) as u64 diff --git a/necsim/impls/no-std/src/cogs/origin_sampler/mod.rs b/necsim/impls/no-std/src/cogs/origin_sampler/mod.rs index 0a3720da6..2d21e7a04 100644 --- a/necsim/impls/no-std/src/cogs/origin_sampler/mod.rs +++ b/necsim/impls/no-std/src/cogs/origin_sampler/mod.rs @@ -13,9 +13,8 @@ pub mod spatially_implicit; use pre_sampler::OriginPreSampler; -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] #[contract_trait] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] /// `Lineage`s produced by the sampler's iterator must have /// * unique global references pub trait UntrustedOriginSampler<'h, M: MathsCore>: @@ -38,7 +37,7 @@ pub trait UntrustedOriginSampler<'h, M: MathsCore>: /// * unique global references /// * unique indexed locations /// * valid indexed locations (i.e. inside habitable demes) -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub unsafe trait TrustedOriginSampler<'h, M: MathsCore>: UntrustedOriginSampler<'h, M> { diff --git a/necsim/impls/no-std/src/cogs/origin_sampler/non_spatial.rs b/necsim/impls/no-std/src/cogs/origin_sampler/non_spatial.rs index 8cebb7036..71d3dab2d 100644 --- a/necsim/impls/no-std/src/cogs/origin_sampler/non_spatial.rs +++ b/necsim/impls/no-std/src/cogs/origin_sampler/non_spatial.rs @@ -16,7 +16,7 @@ use crate::cogs::{ use super::{TrustedOriginSampler, UntrustedOriginSampler}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct NonSpatialOriginSampler<'h, M: MathsCore, I: Iterator> { pre_sampler: OriginPreSampler, last_index: u64, @@ -66,11 +66,7 @@ impl<'h, M: MathsCore, I: Iterator> UntrustedOriginSampler<'h, M> } fn full_upper_bound_size_hint(&self) -> u64 { - #[allow( - clippy::cast_possible_truncation, - clippy::cast_sign_loss, - clippy::cast_precision_loss - )] + #[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)] { (f64::from(self.habitat.get_total_habitat()) * self.pre_sampler.get_sample_proportion().get()) as u64 diff --git a/necsim/impls/no-std/src/cogs/origin_sampler/pre_sampler.rs b/necsim/impls/no-std/src/cogs/origin_sampler/pre_sampler.rs index 6fb1072a6..67240d589 100644 --- a/necsim/impls/no-std/src/cogs/origin_sampler/pre_sampler.rs +++ b/necsim/impls/no-std/src/cogs/origin_sampler/pre_sampler.rs @@ -11,7 +11,7 @@ use necsim_partitioning_core::partition::Partition; const INV_PHI: f64 = 6.180_339_887_498_949e-1_f64; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct OriginPreSampler> { inner: I, proportion: ClosedUnitF64, @@ -91,7 +91,7 @@ impl> OriginPreSampler { *quasi_random += INV_PHI; *quasi_random -= M::floor(*quasi_random); - #[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)] + #[expect(clippy::cast_sign_loss, clippy::cast_possible_truncation)] let skip = M::floor(M::ln(*quasi_random) * inv_geometric_sample_rate) as usize; self.nth(skip) diff --git a/necsim/impls/no-std/src/cogs/origin_sampler/resuming.rs b/necsim/impls/no-std/src/cogs/origin_sampler/resuming.rs index 72e6fcf1e..b182a27d1 100644 --- a/necsim/impls/no-std/src/cogs/origin_sampler/resuming.rs +++ b/necsim/impls/no-std/src/cogs/origin_sampler/resuming.rs @@ -9,7 +9,7 @@ use crate::cogs::origin_sampler::{pre_sampler::OriginPreSampler, TrustedOriginSa use super::UntrustedOriginSampler; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct ResumingOriginSampler< 'h, M: MathsCore, @@ -80,7 +80,7 @@ impl< } fn full_upper_bound_size_hint(&self) -> u64 { - #[allow( + #[expect( clippy::cast_precision_loss, clippy::cast_possible_truncation, clippy::cast_sign_loss diff --git a/necsim/impls/no-std/src/cogs/origin_sampler/singleton_demes/circle.rs b/necsim/impls/no-std/src/cogs/origin_sampler/singleton_demes/circle.rs index 2d2e786c6..429b9db96 100644 --- a/necsim/impls/no-std/src/cogs/origin_sampler/singleton_demes/circle.rs +++ b/necsim/impls/no-std/src/cogs/origin_sampler/singleton_demes/circle.rs @@ -12,7 +12,6 @@ use crate::cogs::{ origin_sampler::{pre_sampler::OriginPreSampler, TrustedOriginSampler, UntrustedOriginSampler}, }; -#[allow(clippy::module_name_repetitions)] pub struct SingletonDemesCircleOriginSampler< 'h, M: MathsCore, @@ -68,7 +67,7 @@ impl<'h, M: MathsCore, H: SingletonDemesHabitat, I: Iterator> diameter, ); - #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] + #[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)] let upper_bound_size_hint = M::ceil( f64::from(radius) * f64::from(radius) diff --git a/necsim/impls/no-std/src/cogs/origin_sampler/singleton_demes/downscaled.rs b/necsim/impls/no-std/src/cogs/origin_sampler/singleton_demes/downscaled.rs index bd9cf1ab9..13ea58e60 100644 --- a/necsim/impls/no-std/src/cogs/origin_sampler/singleton_demes/downscaled.rs +++ b/necsim/impls/no-std/src/cogs/origin_sampler/singleton_demes/downscaled.rs @@ -13,7 +13,6 @@ use crate::cogs::{ origin_sampler::{pre_sampler::OriginPreSampler, TrustedOriginSampler, UntrustedOriginSampler}, }; -#[allow(clippy::module_name_repetitions)] pub struct AlmostInfiniteDownscaledOriginSampler< 'h, M: MathsCore, diff --git a/necsim/impls/no-std/src/cogs/origin_sampler/singleton_demes/mod.rs b/necsim/impls/no-std/src/cogs/origin_sampler/singleton_demes/mod.rs index 1db3748a1..a76358915 100644 --- a/necsim/impls/no-std/src/cogs/origin_sampler/singleton_demes/mod.rs +++ b/necsim/impls/no-std/src/cogs/origin_sampler/singleton_demes/mod.rs @@ -11,7 +11,7 @@ pub mod circle; pub mod downscaled; pub mod rectangle; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub enum SingletonDemesOriginSampler< 'h, M: MathsCore, diff --git a/necsim/impls/no-std/src/cogs/origin_sampler/singleton_demes/rectangle.rs b/necsim/impls/no-std/src/cogs/origin_sampler/singleton_demes/rectangle.rs index e4005cec1..a2e836df0 100644 --- a/necsim/impls/no-std/src/cogs/origin_sampler/singleton_demes/rectangle.rs +++ b/necsim/impls/no-std/src/cogs/origin_sampler/singleton_demes/rectangle.rs @@ -14,7 +14,6 @@ use crate::cogs::{ origin_sampler::{pre_sampler::OriginPreSampler, TrustedOriginSampler, UntrustedOriginSampler}, }; -#[allow(clippy::module_name_repetitions)] pub struct SingletonDemesRectangleOriginSampler< 'h, M: MathsCore, @@ -77,7 +76,7 @@ impl<'h, M: MathsCore, H: SingletonDemesHabitat, I: Iterator> } fn full_upper_bound_size_hint(&self) -> u64 { - #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] + #[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)] { (f64::from(self.sample.width()) * f64::from(self.sample.height()) diff --git a/necsim/impls/no-std/src/cogs/origin_sampler/spatially_implicit.rs b/necsim/impls/no-std/src/cogs/origin_sampler/spatially_implicit.rs index 30fe6915b..d0aef7c29 100644 --- a/necsim/impls/no-std/src/cogs/origin_sampler/spatially_implicit.rs +++ b/necsim/impls/no-std/src/cogs/origin_sampler/spatially_implicit.rs @@ -9,7 +9,7 @@ use crate::cogs::{ use super::{TrustedOriginSampler, UntrustedOriginSampler}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct SpatiallyImplicitOriginSampler<'h, M: MathsCore, I: Iterator> { local_iterator: NonSpatialOriginSampler<'h, M, I>, habitat: &'h SpatiallyImplicitHabitat, diff --git a/necsim/impls/no-std/src/cogs/rng/rand.rs b/necsim/impls/no-std/src/cogs/rng/rand.rs index d29ceeb1b..dcef65e47 100644 --- a/necsim/impls/no-std/src/cogs/rng/rand.rs +++ b/necsim/impls/no-std/src/cogs/rng/rand.rs @@ -5,7 +5,7 @@ use necsim_core::cogs::{Backup, MathsCore, RngCore}; use rand_core::{RngCore as RandRngCore, SeedableRng as RandSeedableRng}; use serde::{de::DeserializeOwned, Deserialize, Deserializer, Serialize, Serializer}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Clone, TypeLayout)] #[layout(free = "M")] #[repr(transparent)] diff --git a/necsim/impls/no-std/src/cogs/rng/seahash.rs b/necsim/impls/no-std/src/cogs/rng/seahash.rs index d13be722f..d5867f5d2 100644 --- a/necsim/impls/no-std/src/cogs/rng/seahash.rs +++ b/necsim/impls/no-std/src/cogs/rng/seahash.rs @@ -4,7 +4,6 @@ use necsim_core::cogs::{MathsCore, PrimeableRng, RngCore}; use serde::{Deserialize, Serialize}; -#[allow(clippy::module_name_repetitions)] #[derive(Debug, Serialize, Deserialize, TypeLayout)] #[serde(deny_unknown_fields)] #[layout(free = "M")] diff --git a/necsim/impls/no-std/src/cogs/rng/wyhash.rs b/necsim/impls/no-std/src/cogs/rng/wyhash.rs index 83f06deb9..dc2bd039a 100644 --- a/necsim/impls/no-std/src/cogs/rng/wyhash.rs +++ b/necsim/impls/no-std/src/cogs/rng/wyhash.rs @@ -11,7 +11,6 @@ const P1: u64 = 0xe703_7ed1_a0b4_28db; const P2: u64 = 0x8ebc_6af0_9c88_c6e3; const P5: u64 = 0xeb44_acca_b455_d165; -#[allow(clippy::module_name_repetitions)] #[derive(Debug, Serialize, Deserialize, TypeLayout)] #[layout(free = "M")] #[serde(deny_unknown_fields)] @@ -81,7 +80,7 @@ impl PrimeableRng for WyHash { } #[inline] -#[allow(clippy::cast_possible_truncation)] +#[expect(clippy::cast_possible_truncation)] fn wymum(mut a: u64, mut b: u64) -> u64 { // WyHash diffusion function // https://docs.rs/wyhash/0.5.0/src/wyhash/functions.rs.html#8-12 diff --git a/necsim/impls/no-std/src/cogs/speciation_probability/spatially_implicit.rs b/necsim/impls/no-std/src/cogs/speciation_probability/spatially_implicit.rs index 2321250b9..6202c19f8 100644 --- a/necsim/impls/no-std/src/cogs/speciation_probability/spatially_implicit.rs +++ b/necsim/impls/no-std/src/cogs/speciation_probability/spatially_implicit.rs @@ -8,7 +8,7 @@ use crate::cogs::habitat::spatially_implicit::SpatiallyImplicitHabitat; #[derive(Clone, Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct SpatiallyImplicitSpeciationProbability { meta_speciation_probability: PositiveUnitF64, } diff --git a/necsim/impls/no-std/src/cogs/speciation_probability/uniform.rs b/necsim/impls/no-std/src/cogs/speciation_probability/uniform.rs index 9c119db94..78833e158 100644 --- a/necsim/impls/no-std/src/cogs/speciation_probability/uniform.rs +++ b/necsim/impls/no-std/src/cogs/speciation_probability/uniform.rs @@ -6,7 +6,7 @@ use necsim_core_bond::ClosedUnitF64; #[derive(Clone, Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct UniformSpeciationProbability { speciation_probability: ClosedUnitF64, } diff --git a/necsim/impls/no-std/src/cogs/turnover_rate/in_memory.rs b/necsim/impls/no-std/src/cogs/turnover_rate/in_memory.rs index f12800b11..91867a36b 100644 --- a/necsim/impls/no-std/src/cogs/turnover_rate/in_memory.rs +++ b/necsim/impls/no-std/src/cogs/turnover_rate/in_memory.rs @@ -10,7 +10,7 @@ use necsim_core_bond::NonNegativeF64; use crate::{array2d::Array2D, cogs::habitat::in_memory::InMemoryHabitat}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Clone, Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] pub struct InMemoryTurnoverRate { @@ -40,7 +40,7 @@ impl TurnoverRate> for InMemoryTurnoverRate } } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(displaydoc::Display, Debug)] pub enum InMemoryTurnoverRateError { /// There is some location with zero turnover and non-zero habitat. diff --git a/necsim/impls/no-std/src/cogs/turnover_rate/uniform.rs b/necsim/impls/no-std/src/cogs/turnover_rate/uniform.rs index c2465befc..4eed4bbdd 100644 --- a/necsim/impls/no-std/src/cogs/turnover_rate/uniform.rs +++ b/necsim/impls/no-std/src/cogs/turnover_rate/uniform.rs @@ -6,7 +6,7 @@ use necsim_core_bond::{NonNegativeF64, PositiveF64}; #[derive(Clone, Debug)] #[cfg_attr(feature = "cuda", derive(rust_cuda::lend::LendRustToCuda))] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct UniformTurnoverRate { turnover_rate: PositiveF64, } diff --git a/necsim/impls/no-std/src/decomposition/equal/area.rs b/necsim/impls/no-std/src/decomposition/equal/area.rs index e88f4b556..cf8037c19 100644 --- a/necsim/impls/no-std/src/decomposition/equal/area.rs +++ b/necsim/impls/no-std/src/decomposition/equal/area.rs @@ -37,7 +37,7 @@ impl> EqualDecomposition { .into_iter() .enumerate() .filter_map(|(i, index)| { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let next_rank = ((i as u64) * u64::from(subdomain.size().get()) / num_indices) as u32; diff --git a/necsim/impls/no-std/src/decomposition/equal/mod.rs b/necsim/impls/no-std/src/decomposition/equal/mod.rs index 79619f699..4f0eea7b2 100644 --- a/necsim/impls/no-std/src/decomposition/equal/mod.rs +++ b/necsim/impls/no-std/src/decomposition/equal/mod.rs @@ -16,7 +16,7 @@ mod weight; #[cfg(test)] mod test; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct EqualDecomposition> { subdomain: Partition, @@ -58,7 +58,7 @@ impl> Decomposition for EqualDecomposition (index + 1) as u32, Err(index) => index as u32, @@ -68,7 +68,7 @@ impl> Decomposition for EqualDecomposition> EqualDecomposition { fn next_log2(coord: OffByOneU32) -> u8 { - #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] + #[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)] if coord.get() > 1 { M::ceil(M::ln(f64::from(coord)) / core::f64::consts::LN_2) as u8 } else { diff --git a/necsim/impls/no-std/src/decomposition/equal/weight.rs b/necsim/impls/no-std/src/decomposition/equal/weight.rs index 3790be225..fe1a88e5c 100644 --- a/necsim/impls/no-std/src/decomposition/equal/weight.rs +++ b/necsim/impls/no-std/src/decomposition/equal/weight.rs @@ -46,7 +46,7 @@ impl> EqualDecomposition { let indices: Vec = indices .into_iter() .filter_map(|(index, habitat)| { - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let next_rank = (u128::from(cumulative_habitat) * u128::from(subdomain.size().get()) / u128::from(total_habitat)) as u32; diff --git a/necsim/impls/no-std/src/decomposition/mod.rs b/necsim/impls/no-std/src/decomposition/mod.rs index 7791d99c5..704c27a19 100644 --- a/necsim/impls/no-std/src/decomposition/mod.rs +++ b/necsim/impls/no-std/src/decomposition/mod.rs @@ -9,7 +9,6 @@ pub mod modulo; pub mod monolithic; pub mod radial; -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] #[contract_trait] pub trait Decomposition>: Backup + Sized + core::fmt::Debug { fn get_subdomain(&self) -> Partition; diff --git a/necsim/impls/no-std/src/decomposition/modulo.rs b/necsim/impls/no-std/src/decomposition/modulo.rs index 54a1fa58c..939446e1d 100644 --- a/necsim/impls/no-std/src/decomposition/modulo.rs +++ b/necsim/impls/no-std/src/decomposition/modulo.rs @@ -6,7 +6,7 @@ use necsim_partitioning_core::partition::Partition; use crate::decomposition::Decomposition; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct ModuloDecomposition { subdomain: Partition, @@ -41,7 +41,7 @@ impl> Decomposition for ModuloDecomposition { * u64::from(extent.width()) + u64::from(location.x() - extent.origin().x()); - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] { (location_index % u64::from(self.subdomain.size().get())) as u32 } diff --git a/necsim/impls/no-std/src/decomposition/monolithic.rs b/necsim/impls/no-std/src/decomposition/monolithic.rs index bcb556a29..db8522e08 100644 --- a/necsim/impls/no-std/src/decomposition/monolithic.rs +++ b/necsim/impls/no-std/src/decomposition/monolithic.rs @@ -6,7 +6,7 @@ use necsim_partitioning_core::partition::Partition; use crate::decomposition::Decomposition; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, Default)] pub struct MonolithicDecomposition(()); diff --git a/necsim/impls/no-std/src/decomposition/radial.rs b/necsim/impls/no-std/src/decomposition/radial.rs index c05fa3a63..a15309c1a 100644 --- a/necsim/impls/no-std/src/decomposition/radial.rs +++ b/necsim/impls/no-std/src/decomposition/radial.rs @@ -8,7 +8,7 @@ use necsim_partitioning_core::partition::Partition; use crate::decomposition::Decomposition; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub struct RadialDecomposition { subdomain: Partition, @@ -42,7 +42,7 @@ impl> Decomposition for RadialDecomposition { let neutral_x = location.x().wrapping_sub(extent.origin().x()); let neutral_y = location.y().wrapping_sub(extent.origin().y()); - #[allow(clippy::cast_precision_loss)] + #[expect(clippy::cast_precision_loss)] let fraction = (atan2( (i64::from(neutral_y) - i64::from(extent.height()) / 2) as f64, (i64::from(neutral_x) - i64::from(extent.width()) / 2) as f64, @@ -50,7 +50,7 @@ impl> Decomposition for RadialDecomposition { * 0.5_f64) + 0.5_f64; - #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] + #[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)] { (M::floor(f64::from(self.subdomain.size().get()) * fraction) as u32) .min(self.subdomain.size().get() - 1) diff --git a/necsim/impls/no-std/src/parallelisation/independent/individuals.rs b/necsim/impls/no-std/src/parallelisation/independent/individuals.rs index 6182e0947..4df2633d5 100644 --- a/necsim/impls/no-std/src/parallelisation/independent/individuals.rs +++ b/necsim/impls/no-std/src/parallelisation/independent/individuals.rs @@ -34,7 +34,7 @@ use crate::{ use super::{reporter::IgnoreProgressReporterProxy, DedupCache}; -#[allow(clippy::type_complexity)] +#[expect(clippy::type_complexity)] pub fn simulate< 'p, M: MathsCore, diff --git a/necsim/impls/no-std/src/parallelisation/independent/landscape.rs b/necsim/impls/no-std/src/parallelisation/independent/landscape.rs index 2a28c8ea3..74ef2844d 100644 --- a/necsim/impls/no-std/src/parallelisation/independent/landscape.rs +++ b/necsim/impls/no-std/src/parallelisation/independent/landscape.rs @@ -37,7 +37,7 @@ use crate::{ use super::{reporter::IgnoreProgressReporterProxy, DedupCache}; -#[allow(clippy::type_complexity, clippy::too_many_lines)] +#[expect(clippy::type_complexity)] pub fn simulate< 'p, M: MathsCore, diff --git a/necsim/impls/no-std/src/parallelisation/independent/mod.rs b/necsim/impls/no-std/src/parallelisation/independent/mod.rs index 2af9e12e5..717c7f886 100644 --- a/necsim/impls/no-std/src/parallelisation/independent/mod.rs +++ b/necsim/impls/no-std/src/parallelisation/independent/mod.rs @@ -40,7 +40,7 @@ impl DedupCache { DirectMappedCache::with_capacity(match self { DedupCache::Absolute(AbsoluteCapacity { capacity }) => capacity.get(), DedupCache::Relative(RelativeCapacity { factor }) => { - #[allow( + #[expect( clippy::cast_precision_loss, clippy::cast_sign_loss, clippy::cast_possible_truncation @@ -54,7 +54,7 @@ impl DedupCache { } } -#[allow(clippy::unsafe_derive_deserialize)] +#[expect(clippy::unsafe_derive_deserialize)] #[derive(Copy, Clone, Debug, Serialize, Deserialize)] pub enum EventSlice { Absolute(AbsoluteCapacity), @@ -67,7 +67,7 @@ impl EventSlice { match self { EventSlice::Absolute(AbsoluteCapacity { capacity }) => capacity, EventSlice::Relative(RelativeCapacity { factor }) => { - #[allow( + #[expect( clippy::cast_precision_loss, clippy::cast_sign_loss, clippy::cast_possible_truncation diff --git a/necsim/impls/no-std/src/parallelisation/independent/monolithic/mod.rs b/necsim/impls/no-std/src/parallelisation/independent/monolithic/mod.rs index 6bc67feaa..62cc7015b 100644 --- a/necsim/impls/no-std/src/parallelisation/independent/monolithic/mod.rs +++ b/necsim/impls/no-std/src/parallelisation/independent/monolithic/mod.rs @@ -39,7 +39,7 @@ use reporter::{ WaterLevelReporterConstructor, WaterLevelReporterProxy, WaterLevelReporterStrategy, }; -#[allow(clippy::type_complexity, clippy::too_many_lines)] +#[expect(clippy::type_complexity, clippy::too_many_lines)] pub fn simulate< 'p, M: MathsCore, @@ -118,14 +118,12 @@ pub fn simulate< let mut min_spec_samples = dedup_cache.construct(slow_lineages.len()); let mut total_steps = 0_u64; - #[allow(clippy::or_fun_call)] let mut max_time = slow_lineages .iter() .map(|(lineage, _)| lineage.last_event_time) .max() .unwrap_or(NonNegativeF64::zero()); - #[allow(clippy::or_fun_call)] let mut level_time = slow_lineages .iter() .map(|(lineage, _)| lineage.last_event_time) diff --git a/necsim/impls/no-std/src/parallelisation/independent/monolithic/reporter/live.rs b/necsim/impls/no-std/src/parallelisation/independent/monolithic/reporter/live.rs index 24bb72672..427bb000c 100644 --- a/necsim/impls/no-std/src/parallelisation/independent/monolithic/reporter/live.rs +++ b/necsim/impls/no-std/src/parallelisation/independent/monolithic/reporter/live.rs @@ -12,7 +12,7 @@ use necsim_partitioning_core::LocalPartition; use super::WaterLevelReporterProxy; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct LiveWaterLevelReporterProxy<'l, 'p, R: Reporter, P: LocalPartition<'p, R>> { water_level: NonNegativeF64, slow_events: Vec, diff --git a/necsim/impls/no-std/src/parallelisation/independent/monolithic/reporter/mod.rs b/necsim/impls/no-std/src/parallelisation/independent/monolithic/reporter/mod.rs index 7df56366e..7306e5c99 100644 --- a/necsim/impls/no-std/src/parallelisation/independent/monolithic/reporter/mod.rs +++ b/necsim/impls/no-std/src/parallelisation/independent/monolithic/reporter/mod.rs @@ -10,8 +10,6 @@ use necsim_partitioning_core::LocalPartition; mod live; mod recorded; -#[allow(clippy::inline_always, clippy::inline_fn_without_body)] -#[allow(clippy::no_effect_underscore_binding)] #[contract_trait] pub trait WaterLevelReporterProxy<'l, 'p, R: Reporter, P: LocalPartition<'p, R>>: Sized @@ -32,7 +30,6 @@ pub trait WaterLevelReporterProxy<'l, 'p, R: Reporter, P: LocalPartition<'p, R>> fn local_partition(&mut self) -> &mut P; } -#[allow(clippy::empty_enum)] pub enum WaterLevelReporterStrategy {} pub trait WaterLevelReporterConstructor< diff --git a/necsim/impls/no-std/src/parallelisation/independent/monolithic/reporter/recorded.rs b/necsim/impls/no-std/src/parallelisation/independent/monolithic/reporter/recorded.rs index 455313de5..6c3adb817 100644 --- a/necsim/impls/no-std/src/parallelisation/independent/monolithic/reporter/recorded.rs +++ b/necsim/impls/no-std/src/parallelisation/independent/monolithic/reporter/recorded.rs @@ -7,7 +7,7 @@ use necsim_partitioning_core::LocalPartition; use super::WaterLevelReporterProxy; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct RecordedWaterLevelReporterProxy<'l, 'p, R: Reporter, P: LocalPartition<'p, R>> { water_level: NonNegativeF64, diff --git a/necsim/impls/no-std/src/parallelisation/monolithic/averaging.rs b/necsim/impls/no-std/src/parallelisation/monolithic/averaging.rs index b255c2ab0..ecf123663 100644 --- a/necsim/impls/no-std/src/parallelisation/monolithic/averaging.rs +++ b/necsim/impls/no-std/src/parallelisation/monolithic/averaging.rs @@ -21,7 +21,7 @@ use crate::{ parallelisation::Status, }; -#[allow(clippy::type_complexity)] +#[expect(clippy::type_complexity)] pub fn simulate< 'p, M: MathsCore, diff --git a/necsim/impls/no-std/src/parallelisation/monolithic/lockstep.rs b/necsim/impls/no-std/src/parallelisation/monolithic/lockstep.rs index f1ff75edc..778a1a073 100644 --- a/necsim/impls/no-std/src/parallelisation/monolithic/lockstep.rs +++ b/necsim/impls/no-std/src/parallelisation/monolithic/lockstep.rs @@ -21,7 +21,7 @@ use crate::{ parallelisation::Status, }; -#[allow(clippy::type_complexity)] +#[expect(clippy::type_complexity)] pub fn simulate< 'p, M: MathsCore, diff --git a/necsim/impls/no-std/src/parallelisation/monolithic/mod.rs b/necsim/impls/no-std/src/parallelisation/monolithic/mod.rs index 0cf1900d6..6fba278ae 100644 --- a/necsim/impls/no-std/src/parallelisation/monolithic/mod.rs +++ b/necsim/impls/no-std/src/parallelisation/monolithic/mod.rs @@ -2,7 +2,7 @@ mod reporter; pub mod averaging; pub mod lockstep; -#[allow(clippy::module_inception)] +#[expect(clippy::module_inception)] pub mod monolithic; pub mod optimistic; pub mod optimistic_lockstep; diff --git a/necsim/impls/no-std/src/parallelisation/monolithic/monolithic.rs b/necsim/impls/no-std/src/parallelisation/monolithic/monolithic.rs index 86c1f2418..83cdbf20f 100644 --- a/necsim/impls/no-std/src/parallelisation/monolithic/monolithic.rs +++ b/necsim/impls/no-std/src/parallelisation/monolithic/monolithic.rs @@ -20,7 +20,7 @@ use crate::{ parallelisation::Status, }; -#[allow(clippy::type_complexity)] +#[expect(clippy::type_complexity)] pub fn simulate< 'p, M: MathsCore, diff --git a/necsim/impls/no-std/src/parallelisation/monolithic/optimistic.rs b/necsim/impls/no-std/src/parallelisation/monolithic/optimistic.rs index ee9a55a49..f075f2850 100644 --- a/necsim/impls/no-std/src/parallelisation/monolithic/optimistic.rs +++ b/necsim/impls/no-std/src/parallelisation/monolithic/optimistic.rs @@ -26,7 +26,7 @@ use crate::{ use super::reporter::BufferingReporterProxy; -#[allow(clippy::type_complexity)] +#[expect(clippy::type_complexity)] pub fn simulate< 'p, M: MathsCore, diff --git a/necsim/impls/no-std/src/parallelisation/monolithic/optimistic_lockstep.rs b/necsim/impls/no-std/src/parallelisation/monolithic/optimistic_lockstep.rs index d9cdab94d..5cb1ed6e8 100644 --- a/necsim/impls/no-std/src/parallelisation/monolithic/optimistic_lockstep.rs +++ b/necsim/impls/no-std/src/parallelisation/monolithic/optimistic_lockstep.rs @@ -21,7 +21,7 @@ use crate::{ parallelisation::Status, }; -#[allow(clippy::type_complexity)] +#[expect(clippy::type_complexity)] pub fn simulate< 'p, M: MathsCore, diff --git a/necsim/impls/std/src/cogs/dispersal_sampler/in_memory.rs b/necsim/impls/std/src/cogs/dispersal_sampler/in_memory.rs index 89e101176..98878b6ea 100644 --- a/necsim/impls/std/src/cogs/dispersal_sampler/in_memory.rs +++ b/necsim/impls/std/src/cogs/dispersal_sampler/in_memory.rs @@ -2,7 +2,7 @@ use necsim_impls_no_std::cogs::dispersal_sampler::in_memory::InMemoryDispersalSa use thiserror::Error; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Error, Debug)] #[error("{0}")] pub struct InMemoryDispersalSamplerError(pub InMemoryDispersalSamplerErrorNoStd); diff --git a/necsim/impls/std/src/cogs/rng/pcg.rs b/necsim/impls/std/src/cogs/rng/pcg.rs index 23f5d3d68..bcbdfcee2 100644 --- a/necsim/impls/std/src/cogs/rng/pcg.rs +++ b/necsim/impls/std/src/cogs/rng/pcg.rs @@ -6,7 +6,6 @@ use serde::{Deserialize, Serialize}; use necsim_core::cogs::{MathsCore, RngCore, SplittableRng}; -#[allow(clippy::module_name_repetitions)] #[derive(Serialize, Deserialize)] #[serde(from = "PcgState", into = "PcgState")] pub struct Pcg { @@ -57,7 +56,7 @@ impl RngCore for Pcg { } impl SplittableRng for Pcg { - #[allow(clippy::identity_op)] + #[expect(clippy::identity_op)] fn split(self) -> (Self, Self) { let mut left_state = self.inner.get_state(); left_state.increment = (((left_state.increment >> 1) * 2 + 0) << 1) | 1; diff --git a/necsim/impls/std/src/event_log/mod.rs b/necsim/impls/std/src/event_log/mod.rs index c30da4285..f6c65bc89 100644 --- a/necsim/impls/std/src/event_log/mod.rs +++ b/necsim/impls/std/src/event_log/mod.rs @@ -7,7 +7,7 @@ pub mod recorder; pub mod replay; #[derive(Serialize, Deserialize, PartialEq)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct EventLogHeader { min_time: PositiveF64, max_time: PositiveF64, diff --git a/necsim/impls/std/src/event_log/recorder.rs b/necsim/impls/std/src/event_log/recorder.rs index 4fa7f8d12..7aef8285a 100644 --- a/necsim/impls/std/src/event_log/recorder.rs +++ b/necsim/impls/std/src/event_log/recorder.rs @@ -32,7 +32,7 @@ use necsim_core::event::{DispersalEvent, PackedEvent, SpeciationEvent}; use super::EventLogHeader; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct EventLogRecorder { segment_capacity: NonZeroUsize, directory: PathBuf, @@ -224,7 +224,7 @@ impl fmt::Debug for EventLogRecorder { } } -#[allow(clippy::unsafe_derive_deserialize)] +#[expect(clippy::unsafe_derive_deserialize)] #[derive(Debug, Deserialize)] #[serde(try_from = "EventLogRecorderRaw")] pub struct EventLogConfig { diff --git a/necsim/impls/std/src/event_log/replay/globbed.rs b/necsim/impls/std/src/event_log/replay/globbed.rs index 740640804..aa41f5284 100644 --- a/necsim/impls/std/src/event_log/replay/globbed.rs +++ b/necsim/impls/std/src/event_log/replay/globbed.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer}; use super::segment::SortedSegment; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct GlobbedSortedSegments { segments: Vec, } diff --git a/necsim/impls/std/src/event_log/replay/mod.rs b/necsim/impls/std/src/event_log/replay/mod.rs index bc6a342a6..2a7410c47 100644 --- a/necsim/impls/std/src/event_log/replay/mod.rs +++ b/necsim/impls/std/src/event_log/replay/mod.rs @@ -14,7 +14,7 @@ use globbed::GlobbedSortedSegments; use segment::SortedSegment; use sorted_segments::SortedSortedSegments; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, Deserialize)] #[serde(try_from = "EventLogReplayRaw")] pub struct EventLogReplay { diff --git a/necsim/impls/std/src/event_log/replay/segment.rs b/necsim/impls/std/src/event_log/replay/segment.rs index d63238a9f..b9543f1fe 100644 --- a/necsim/impls/std/src/event_log/replay/segment.rs +++ b/necsim/impls/std/src/event_log/replay/segment.rs @@ -14,7 +14,7 @@ use necsim_core::event::PackedEvent; use crate::event_log::EventLogHeader; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct SortedSegment { path: PathBuf, header: EventLogHeader, diff --git a/necsim/impls/std/src/event_log/replay/sorted_segments.rs b/necsim/impls/std/src/event_log/replay/sorted_segments.rs index 57c18b6e9..8206d6fda 100644 --- a/necsim/impls/std/src/event_log/replay/sorted_segments.rs +++ b/necsim/impls/std/src/event_log/replay/sorted_segments.rs @@ -7,7 +7,7 @@ use necsim_core::event::PackedEvent; use super::segment::SortedSegment; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct SortedSortedSegments { segments: Vec, next: Option, @@ -101,7 +101,6 @@ impl PartialOrd for SortedSortedSegments { } impl PartialEq for SortedSortedSegments { - #[allow(clippy::unconditional_recursion)] fn eq(&self, other: &Self) -> bool { self.next.eq(&other.next) } diff --git a/necsim/impls/std/src/lineage_file/loader.rs b/necsim/impls/std/src/lineage_file/loader.rs index ab7eb10a7..dbc0612d6 100644 --- a/necsim/impls/std/src/lineage_file/loader.rs +++ b/necsim/impls/std/src/lineage_file/loader.rs @@ -11,7 +11,7 @@ use necsim_core::lineage::Lineage; #[derive(Debug, Deserialize, Clone)] #[serde(try_from = "LineageFileLoaderRaw")] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct LineageFileLoader { lineages: Vec, path: PathBuf, diff --git a/necsim/impls/std/src/lineage_file/saver.rs b/necsim/impls/std/src/lineage_file/saver.rs index de53e4a03..8139407d2 100644 --- a/necsim/impls/std/src/lineage_file/saver.rs +++ b/necsim/impls/std/src/lineage_file/saver.rs @@ -12,7 +12,7 @@ use necsim_core::lineage::Lineage; #[derive(Deserialize)] #[serde(try_from = "LineageFileSaverRaw")] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct LineageFileSaver { file: File, path: PathBuf, diff --git a/necsim/partitioning/core/src/iterator.rs b/necsim/partitioning/core/src/iterator.rs index a4a97c7d8..ab61db17e 100644 --- a/necsim/partitioning/core/src/iterator.rs +++ b/necsim/partitioning/core/src/iterator.rs @@ -2,7 +2,7 @@ use alloc::vec::Vec; use necsim_core::lineage::MigratingLineage; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct ImmigrantPopIterator<'i> { immigrants: &'i mut Vec, } diff --git a/necsim/partitioning/core/src/lib.rs b/necsim/partitioning/core/src/lib.rs index 6671d24ea..71f68d67a 100644 --- a/necsim/partitioning/core/src/lib.rs +++ b/necsim/partitioning/core/src/lib.rs @@ -25,7 +25,7 @@ pub trait Partitioning: Sized { fn get_size(&self) -> PartitionSize; - #[allow(clippy::missing_errors_doc)] + #[expect(clippy::missing_errors_doc)] fn with_local_partition< R: Reporter, P: ReporterContext, @@ -74,7 +74,7 @@ pub trait LocalPartition<'p, R: Reporter>: Sized { fn reduce_vote_any(&mut self, vote: bool) -> bool; - #[allow(clippy::missing_errors_doc)] + #[expect(clippy::missing_errors_doc)] fn reduce_vote_min_time(&mut self, local_time: PositiveF64) -> Result; diff --git a/necsim/partitioning/core/src/partition.rs b/necsim/partitioning/core/src/partition.rs index eb7482438..25097dbb1 100644 --- a/necsim/partitioning/core/src/partition.rs +++ b/necsim/partitioning/core/src/partition.rs @@ -3,7 +3,7 @@ use core::{convert::TryFrom, fmt, num::NonZeroU32}; use serde::{Deserialize, Serialize}; #[derive(Debug)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct PartitionRankOutOfBounds(u32, u32); impl fmt::Display for PartitionRankOutOfBounds { @@ -16,7 +16,7 @@ impl fmt::Display for PartitionRankOutOfBounds { } } -#[allow(clippy::module_name_repetitions, clippy::unsafe_derive_deserialize)] +#[expect(clippy::unsafe_derive_deserialize)] #[derive(Copy, Clone, Debug, Serialize, Deserialize)] #[serde(try_from = "PartitionRaw")] pub struct Partition { @@ -90,8 +90,8 @@ struct PartitionRaw { size: PartitionSize, } -#[allow(clippy::module_name_repetitions)] -#[allow(clippy::unsafe_derive_deserialize)] +#[expect(clippy::module_name_repetitions)] +#[expect(clippy::unsafe_derive_deserialize)] #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] #[serde(transparent)] pub struct PartitionSize(pub NonZeroU32); diff --git a/necsim/partitioning/core/src/reporter.rs b/necsim/partitioning/core/src/reporter.rs index 3ad1411fb..a7124669a 100644 --- a/necsim/partitioning/core/src/reporter.rs +++ b/necsim/partitioning/core/src/reporter.rs @@ -1,6 +1,6 @@ use necsim_core::reporter::{boolean::Boolean, FilteredReporter, Reporter}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait ReporterContext: core::fmt::Debug { type Reporter: Reporter; @@ -12,12 +12,12 @@ pub trait ReporterContext: core::fmt::Debug { ) -> anyhow::Result>; } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait FinalisableReporter { fn finalise(self); } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct OpaqueFinalisableReporter { reporter: R, } diff --git a/necsim/partitioning/monolithic/src/lib.rs b/necsim/partitioning/monolithic/src/lib.rs index 3511c3979..597aa5c56 100644 --- a/necsim/partitioning/monolithic/src/lib.rs +++ b/necsim/partitioning/monolithic/src/lib.rs @@ -26,7 +26,6 @@ use necsim_impls_std::event_log::recorder::EventLogConfig; pub mod live; pub mod recorded; -#[allow(clippy::module_name_repetitions)] #[derive(Default)] pub struct MonolithicPartitioning(()); @@ -88,7 +87,6 @@ impl Partitioning for MonolithicPartitioning { } } -#[allow(clippy::module_name_repetitions)] #[derive(Debug)] pub enum MonolithicLocalPartition { Live(Box>), diff --git a/necsim/partitioning/monolithic/src/live.rs b/necsim/partitioning/monolithic/src/live.rs index 3d9337065..0ed914d96 100644 --- a/necsim/partitioning/monolithic/src/live.rs +++ b/necsim/partitioning/monolithic/src/live.rs @@ -10,7 +10,7 @@ use necsim_partitioning_core::{ iterator::ImmigrantPopIterator, partition::Partition, LocalPartition, MigrationMode, }; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct LiveMonolithicLocalPartition { reporter: FilteredReporter, loopback: Vec, diff --git a/necsim/partitioning/monolithic/src/recorded.rs b/necsim/partitioning/monolithic/src/recorded.rs index 7ece1c10b..33580c3a3 100644 --- a/necsim/partitioning/monolithic/src/recorded.rs +++ b/necsim/partitioning/monolithic/src/recorded.rs @@ -18,7 +18,7 @@ use necsim_partitioning_core::{ iterator::ImmigrantPopIterator, partition::Partition, LocalPartition, MigrationMode, }; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct RecordedMonolithicLocalPartition { reporter: FilteredReporter, recorder: EventLogRecorder, diff --git a/necsim/partitioning/mpi/src/lib.rs b/necsim/partitioning/mpi/src/lib.rs index 9e9234eb2..c699483cf 100644 --- a/necsim/partitioning/mpi/src/lib.rs +++ b/necsim/partitioning/mpi/src/lib.rs @@ -170,7 +170,7 @@ impl Partitioning for MpiPartitioning { type LocalPartition<'p, R: Reporter> = MpiLocalPartition<'p, R>; fn get_size(&self) -> PartitionSize { - #[allow(clippy::cast_sign_loss)] + #[expect(clippy::cast_sign_loss)] let size = unsafe { NonZeroU32::new_unchecked(self.world.size() as u32) }; PartitionSize(size) @@ -206,7 +206,7 @@ impl Partitioning for MpiPartitioning { let mut mpi_local_global_wait = (false, false); let mut mpi_local_remaining = 0_u64; - #[allow(clippy::cast_sign_loss)] + #[expect(clippy::cast_sign_loss)] let world_size = self.world.size() as usize; let mut mpi_emigration_buffers: Vec> = Vec::with_capacity(world_size); @@ -259,7 +259,6 @@ impl Partitioning for MpiPartitioning { #[serde(deny_unknown_fields)] #[serde(deserialize_state = "PartitionSize")] #[serde(default)] -#[allow(dead_code)] struct MpiPartitioningRaw { #[serde(deserialize_state_with = "deserialize_state_mpi_world")] world: Option, @@ -307,7 +306,7 @@ fn reduce_partitioning_data( let local_ser_len = Count::try_from(local_ser.len()) .context("MPI local partition result is too big to share")?; - #[allow(clippy::cast_sign_loss)] + #[expect(clippy::cast_sign_loss)] let mut counts = vec![0 as Count; world.size() as usize]; world.all_gather_into(&local_ser_len, &mut counts); @@ -326,7 +325,7 @@ fn reduce_partitioning_data( }) .collect::, _>>()?; - #[allow(clippy::cast_sign_loss)] + #[expect(clippy::cast_sign_loss)] let mut all_sers = vec![0_u8; counts.iter().copied().sum::() as usize]; world.all_gather_varcount_into( local_ser.as_slice(), @@ -337,7 +336,7 @@ fn reduce_partitioning_data( .iter() .scan(0_usize, |acc, &x| { let pre = *acc; - #[allow(clippy::cast_sign_loss)] + #[expect(clippy::cast_sign_loss)] { *acc += x as usize; } diff --git a/necsim/partitioning/mpi/src/partition/common.rs b/necsim/partitioning/mpi/src/partition/common.rs index 249a30cc9..0d2596e85 100644 --- a/necsim/partitioning/mpi/src/partition/common.rs +++ b/necsim/partitioning/mpi/src/partition/common.rs @@ -51,7 +51,7 @@ impl<'p> MpiCommonPartition<'p> { ) -> Self { let world = universe.world(); - #[allow(clippy::cast_sign_loss)] + #[expect(clippy::cast_sign_loss)] let world_size = world.size() as usize; let mut migration_buffers = Vec::with_capacity(world_size); @@ -83,9 +83,9 @@ impl<'p> MpiCommonPartition<'p> { #[must_use] pub fn get_partition(&self) -> Partition { - #[allow(clippy::cast_sign_loss)] + #[expect(clippy::cast_sign_loss)] let rank = self.world.rank() as u32; - #[allow(clippy::cast_sign_loss)] + #[expect(clippy::cast_sign_loss)] let size = unsafe { NonZeroU32::new_unchecked(self.world.size() as u32) }; unsafe { Partition::new_unchecked(rank, PartitionSize(size)) } @@ -128,7 +128,7 @@ impl<'p> MpiCommonPartition<'p> { while let Some((msg, status)) = any_process.immediate_matched_probe_with_tag(MpiPartitioning::MPI_MIGRATION_TAG) { - #[allow(clippy::cast_sign_loss)] + #[expect(clippy::cast_sign_loss)] let number_immigrants = status.count(MpiMigratingLineage::equivalent_datatype()) as usize; @@ -175,7 +175,7 @@ impl<'p> MpiCommonPartition<'p> { let emigration_buffer = &mut self.migration_buffers[rank_index]; if !emigration_buffer.is_empty() { - #[allow(clippy::cast_possible_wrap)] + #[expect(clippy::cast_possible_wrap)] let receiver_process = self.world.process_at_rank(partition.rank() as i32); let mut last_migration_time = self.last_migration_times[rank_index]; diff --git a/necsim/partitioning/mpi/src/partition/mod.rs b/necsim/partitioning/mpi/src/partition/mod.rs index 2cc9a80c9..362ac6d1d 100644 --- a/necsim/partitioning/mpi/src/partition/mod.rs +++ b/necsim/partitioning/mpi/src/partition/mod.rs @@ -16,14 +16,14 @@ mod parallel; mod root; mod utils; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub use parallel::MpiParallelPartition; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub use root::MpiRootPartition; use crate::FinalisableMpiReporter; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug)] pub enum MpiLocalPartition<'p, R: Reporter> { Root(Box>), diff --git a/necsim/partitioning/mpi/src/partition/root.rs b/necsim/partitioning/mpi/src/partition/root.rs index 7153c28ac..7c80b56b8 100644 --- a/necsim/partitioning/mpi/src/partition/root.rs +++ b/necsim/partitioning/mpi/src/partition/root.rs @@ -176,7 +176,7 @@ impl<'p, R: Reporter> Reporter for MpiRootPartition<'p, R> { { let remaining_status: (u64, _) = msg.matched_receive(); - #[allow(clippy::cast_sign_loss)] + #[expect(clippy::cast_sign_loss)] { self.all_remaining[remaining_status.1.source_rank() as usize] = remaining_status.0; } } diff --git a/necsim/partitioning/mpi/src/partition/utils.rs b/necsim/partitioning/mpi/src/partition/utils.rs index ef1400166..1f671ac00 100644 --- a/necsim/partitioning/mpi/src/partition/utils.rs +++ b/necsim/partitioning/mpi/src/partition/utils.rs @@ -115,7 +115,7 @@ impl MpiMigratingLineage { unsafe impl Equivalence for MpiMigratingLineage { type Out = UserDatatype; - #[allow(clippy::cast_possible_wrap)] + #[expect(clippy::cast_possible_wrap)] fn equivalent_datatype() -> Self::Out { // Ensure compilation breaks if a new field is added let MigratingLineage { diff --git a/necsim/partitioning/mpi/src/request.rs b/necsim/partitioning/mpi/src/request.rs index d95f1d8b9..ffeedc24c 100644 --- a/necsim/partitioning/mpi/src/request.rs +++ b/necsim/partitioning/mpi/src/request.rs @@ -1,6 +1,6 @@ use mpi::request::{CancelGuard, LocalScope, Request}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct DataOrRequest<'a, T: ?Sized, R: ?Sized> { value: &'a mut T, scope: &'a LocalScope<'a>, diff --git a/necsim/partitioning/threads/src/lib.rs b/necsim/partitioning/threads/src/lib.rs index 256b13f13..cbd8d85e0 100644 --- a/necsim/partitioning/threads/src/lib.rs +++ b/necsim/partitioning/threads/src/lib.rs @@ -136,7 +136,7 @@ impl Partitioning for ThreadsPartitioning { self.num_threads } - #[allow(clippy::too_many_lines)] + #[expect(clippy::too_many_lines)] /// # Errors /// /// Returns `MissingEventLog` if the local partition is non-monolithic and diff --git a/necsim/partitioning/threads/src/partition.rs b/necsim/partitioning/threads/src/partition.rs index 22bbfeb5b..8d530d7ab 100644 --- a/necsim/partitioning/threads/src/partition.rs +++ b/necsim/partitioning/threads/src/partition.rs @@ -25,7 +25,7 @@ use necsim_partitioning_core::{partition::Partition, LocalPartition, MigrationMo use crate::vote::{AsyncVote, Vote}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct ThreadsLocalPartition { partition: Partition, vote_any: Vote, @@ -54,7 +54,7 @@ impl fmt::Debug for ThreadsLocalPartition { } impl ThreadsLocalPartition { - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] #[must_use] pub(crate) fn new( partition: Partition, diff --git a/necsim/partitioning/threads/src/vote.rs b/necsim/partitioning/threads/src/vote.rs index e6174b567..dea41d3af 100644 --- a/necsim/partitioning/threads/src/vote.rs +++ b/necsim/partitioning/threads/src/vote.rs @@ -71,7 +71,7 @@ impl Vote { } } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Clone)] pub struct AsyncVote { shared: Arc>, @@ -91,7 +91,6 @@ struct AsyncGenerationalData { } impl AsyncVote { - #[allow(dead_code)] #[must_use] pub fn new(n: usize) -> Self where diff --git a/necsim/plugins/common/src/biodiversity.rs b/necsim/plugins/common/src/biodiversity.rs index 8c9379829..574c54ef8 100644 --- a/necsim/plugins/common/src/biodiversity.rs +++ b/necsim/plugins/common/src/biodiversity.rs @@ -2,7 +2,7 @@ use std::fmt; use necsim_core::{event::SpeciationEvent, impl_finalise, impl_report, reporter::Reporter}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct BiodiversityReporter { last_event: Option, diff --git a/necsim/plugins/common/src/event_counter.rs b/necsim/plugins/common/src/event_counter.rs index a65901ce4..00334ec27 100644 --- a/necsim/plugins/common/src/event_counter.rs +++ b/necsim/plugins/common/src/event_counter.rs @@ -8,7 +8,7 @@ use necsim_core::{ }; use necsim_core_bond::NonNegativeF64; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Default)] pub struct EventCounterReporter { last_parent_prior_time: Option, diff --git a/necsim/plugins/common/src/execution_time.rs b/necsim/plugins/common/src/execution_time.rs index 5c98930fa..71067c1c1 100644 --- a/necsim/plugins/common/src/execution_time.rs +++ b/necsim/plugins/common/src/execution_time.rs @@ -2,7 +2,7 @@ use std::{fmt, time::Instant}; use necsim_core::{impl_finalise, impl_report, reporter::Reporter}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct ExecutionTimeReporter { init_time: Instant, start_time: Option, diff --git a/necsim/plugins/common/src/progress.rs b/necsim/plugins/common/src/progress.rs index a5a55c19f..f2d768e9a 100644 --- a/necsim/plugins/common/src/progress.rs +++ b/necsim/plugins/common/src/progress.rs @@ -17,7 +17,7 @@ struct ProgressUpdater { sender: Sender<()>, } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct ProgressReporter { updater: Option, last_remaining: Arc, @@ -141,7 +141,7 @@ impl Default for ProgressReporter { fn display_progress(total: u64, remaining: u64) { const UPDATE_PRECISION: usize = 50; - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let display_progress = ((total - remaining) * (UPDATE_PRECISION as u64) / total.max(1)) as usize; diff --git a/necsim/plugins/common/src/verbose.rs b/necsim/plugins/common/src/verbose.rs index 0cda89a10..08049d255 100644 --- a/necsim/plugins/common/src/verbose.rs +++ b/necsim/plugins/common/src/verbose.rs @@ -2,7 +2,7 @@ use std::fmt; use necsim_core::{impl_report, reporter::Reporter}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Default)] pub struct VerboseReporter(()); diff --git a/necsim/plugins/core/src/export.rs b/necsim/plugins/core/src/export.rs index 2a0a80ab9..a1f6400d5 100644 --- a/necsim/plugins/core/src/export.rs +++ b/necsim/plugins/core/src/export.rs @@ -13,25 +13,24 @@ pub struct ReporterPluginDeclaration { pub rustc_version: &'static str, pub core_version: &'static str, - #[allow(improper_ctypes_definitions)] + #[expect(improper_ctypes_definitions)] pub init: unsafe extern "C" fn(&'static dyn log::Log, log::LevelFilter), - #[allow(improper_ctypes_definitions)] + #[expect(improper_ctypes_definitions)] pub deserialise: unsafe extern "C" fn( &mut dyn erased_serde::Deserializer, ) -> Result, erased_serde::Error>, - #[allow(improper_ctypes_definitions)] + #[expect(improper_ctypes_definitions)] pub library_path: unsafe extern "C" fn() -> Option<::std::path::PathBuf>, - #[allow(improper_ctypes_definitions)] + #[expect(improper_ctypes_definitions)] pub drop: unsafe extern "C" fn(ManuallyDrop), } #[derive(Copy, Clone)] -#[allow(dead_code)] pub struct ReporterPluginFilter { pub(crate) report_speciation: bool, pub(crate) report_dispersal: bool, @@ -96,7 +95,7 @@ impl From for UnsafeReporterPlugin { } #[macro_export] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] macro_rules! export_plugin { ($($name:ident => $plugin:ty),+$(,)?) => { #[doc(hidden)] @@ -116,7 +115,7 @@ macro_rules! export_plugin { ::std::mem::ManuallyDrop<$crate::export::UnsafeReporterPlugin>, $crate::erased_serde::Error, > { - #[allow(clippy::enum_variant_names)] + #[expect(clippy::enum_variant_names)] #[derive($crate::serde::Deserialize)] #[serde(crate = "::necsim_plugins_core::serde")] enum Reporters { diff --git a/necsim/plugins/core/src/import/plugin.rs b/necsim/plugins/core/src/import/plugin.rs index 116a5be51..a7eaae5fa 100644 --- a/necsim/plugins/core/src/import/plugin.rs +++ b/necsim/plugins/core/src/import/plugin.rs @@ -5,7 +5,7 @@ use crate::{ import::serde::PluginLibrary, }; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct ReporterPlugin { pub(crate) library: Rc, diff --git a/necsim/plugins/csv/src/lib.rs b/necsim/plugins/csv/src/lib.rs index a459560f2..36bc77039 100644 --- a/necsim/plugins/csv/src/lib.rs +++ b/necsim/plugins/csv/src/lib.rs @@ -17,7 +17,6 @@ use necsim_core::{ necsim_plugins_core::export_plugin!(Csv => CsvReporter); -#[allow(clippy::module_name_repetitions)] #[derive(Deserialize)] #[serde(try_from = "CsvReporterArgs")] pub struct CsvReporter { diff --git a/necsim/plugins/metacommunity/src/lib.rs b/necsim/plugins/metacommunity/src/lib.rs index 880161551..ebb8edf3b 100644 --- a/necsim/plugins/metacommunity/src/lib.rs +++ b/necsim/plugins/metacommunity/src/lib.rs @@ -13,7 +13,6 @@ use necsim_core::{event::SpeciationEvent, impl_finalise, impl_report, reporter:: necsim_plugins_core::export_plugin!(Metacommunity => MetacommunityMigrationReporter); -#[allow(clippy::module_name_repetitions)] #[derive(Deserialize)] #[serde(from = "MetacommunityMigrationReporterArgs")] pub struct MetacommunityMigrationReporter { diff --git a/necsim/plugins/species/src/identity.rs b/necsim/plugins/species/src/identity.rs index d6aa2b7bc..f1d2c2dba 100644 --- a/necsim/plugins/species/src/identity.rs +++ b/necsim/plugins/species/src/identity.rs @@ -10,7 +10,7 @@ use necsim_core::{ }; use necsim_core_bond::PositiveF64; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] #[repr(transparent)] pub struct SpeciesIdentity([u8; 24]); @@ -57,7 +57,6 @@ impl SpeciesIdentity { Self::from_raw(lineage, marker, anchor) } - #[allow(dead_code)] pub fn try_into_speciation(self) -> Result<(IndexedLocation, PositiveF64), Self> { let (location, index, time) = self.copy_into_raw(); @@ -67,10 +66,10 @@ impl SpeciesIdentity { return Err(self); } - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let x = (location & u64::from(u32::MAX)) as u32; let y = ((location >> 32) & u64::from(u32::MAX)) as u32; - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let i = ((index >> 16) & u64::from(u32::MAX)) as u32; let origin = IndexedLocation::new(Location::new(x, y), i); diff --git a/necsim/plugins/species/src/individual/feather/mod.rs b/necsim/plugins/species/src/individual/feather/mod.rs index 636196d8a..3cb45e704 100644 --- a/necsim/plugins/species/src/individual/feather/mod.rs +++ b/necsim/plugins/species/src/individual/feather/mod.rs @@ -19,7 +19,6 @@ use crate::{LastEventState, SpeciesIdentity}; mod dataframe; mod reporter; -#[allow(clippy::module_name_repetitions)] pub struct IndividualSpeciesFeatherReporter { last_parent_prior_time: Option<(GlobalLineageReference, NonNegativeF64)>, last_speciation_event: Option, @@ -64,7 +63,7 @@ impl serde::Serialize for IndividualSpeciesFeatherReporter { } } -#[allow(clippy::too_many_lines)] +#[expect(clippy::too_many_lines)] impl<'de> Deserialize<'de> for IndividualSpeciesFeatherReporter { fn deserialize>(deserializer: D) -> Result { let args = IndividualSpeciesFeatherReporterArgs::deserialize(deserializer)?; diff --git a/necsim/plugins/species/src/individual/sqlite/database.rs b/necsim/plugins/species/src/individual/sqlite/database.rs index d472111eb..d512083a3 100644 --- a/necsim/plugins/species/src/individual/sqlite/database.rs +++ b/necsim/plugins/species/src/individual/sqlite/database.rs @@ -64,7 +64,7 @@ impl IndividualSpeciesSQLiteReporter { } } - #[allow(clippy::too_many_lines)] + #[expect(clippy::too_many_lines)] pub(super) fn initialise_sqlite_connection(&mut self) -> rusqlite::Result<()> { self.connection .pragma_update(None, "cache_size", self.cache.get())?; diff --git a/necsim/plugins/species/src/individual/sqlite/mod.rs b/necsim/plugins/species/src/individual/sqlite/mod.rs index de16b552b..11b7eada5 100644 --- a/necsim/plugins/species/src/individual/sqlite/mod.rs +++ b/necsim/plugins/species/src/individual/sqlite/mod.rs @@ -16,7 +16,6 @@ use crate::SpeciesIdentity; mod database; mod reporter; -#[allow(clippy::module_name_repetitions)] pub struct IndividualSpeciesSQLiteReporter { last_parent_prior_time: Option<(GlobalLineageReference, NonNegativeF64)>, last_speciation_event: Option, diff --git a/necsim/plugins/species/src/location/feather/dataframe.rs b/necsim/plugins/species/src/location/feather/dataframe.rs index 653472f6d..c028ad1fc 100644 --- a/necsim/plugins/species/src/location/feather/dataframe.rs +++ b/necsim/plugins/species/src/location/feather/dataframe.rs @@ -74,7 +74,7 @@ impl LocationSpeciesFeatherReporter { } } - #[allow(clippy::too_many_lines)] + #[expect(clippy::too_many_lines)] pub(super) fn output_to_dataframe(mut self) -> arrow2::error::Result<()> { let file = File::options() .write(true) diff --git a/necsim/plugins/species/src/location/feather/mod.rs b/necsim/plugins/species/src/location/feather/mod.rs index 106c4f37f..a794eaae5 100644 --- a/necsim/plugins/species/src/location/feather/mod.rs +++ b/necsim/plugins/species/src/location/feather/mod.rs @@ -19,7 +19,6 @@ use crate::{LastEventState, SpeciesIdentity}; mod dataframe; mod reporter; -#[allow(clippy::module_name_repetitions)] pub struct LocationSpeciesFeatherReporter { last_parent_prior_time: Option<(GlobalLineageReference, NonNegativeF64)>, last_speciation_event: Option, @@ -78,7 +77,7 @@ impl serde::Serialize for LocationSpeciesFeatherReporter { } } -#[allow(clippy::too_many_lines)] +#[expect(clippy::too_many_lines)] impl<'de> Deserialize<'de> for LocationSpeciesFeatherReporter { fn deserialize>(deserializer: D) -> Result { let args = LocationSpeciesFeatherReporterArgs::deserialize(deserializer)?; diff --git a/necsim/plugins/species/src/state.rs b/necsim/plugins/species/src/state.rs index 08c7fa185..945ca6005 100644 --- a/necsim/plugins/species/src/state.rs +++ b/necsim/plugins/species/src/state.rs @@ -7,7 +7,7 @@ use necsim_core::{ }; use necsim_core_bond::NonNegativeF64; -#[allow(clippy::module_name_repetitions, clippy::struct_field_names)] +#[expect(clippy::module_name_repetitions, clippy::struct_field_names)] #[derive(Serialize, Deserialize)] pub struct LastEventState { pub last_parent_prior_time: Option<(GlobalLineageReference, NonNegativeF64)>, diff --git a/necsim/plugins/statistics/src/coverage.rs b/necsim/plugins/statistics/src/coverage.rs index b40bbca5d..eaa42b02b 100644 --- a/necsim/plugins/statistics/src/coverage.rs +++ b/necsim/plugins/statistics/src/coverage.rs @@ -10,7 +10,6 @@ use serde::{Deserialize, Serialize}; use necsim_core::{event::DispersalEvent, impl_finalise, impl_report, reporter::Reporter}; -#[allow(clippy::module_name_repetitions)] #[derive(Deserialize)] #[serde(try_from = "GlobalCoverageReporterArgs")] pub struct GlobalCoverageReporter { diff --git a/necsim/plugins/statistics/src/speciation.rs b/necsim/plugins/statistics/src/speciation.rs index e2c7fc9ff..aa412e71b 100644 --- a/necsim/plugins/statistics/src/speciation.rs +++ b/necsim/plugins/statistics/src/speciation.rs @@ -10,7 +10,6 @@ use serde::{Deserialize, Serialize}; use necsim_core::{event::SpeciationEvent, impl_finalise, impl_report, reporter::Reporter}; -#[allow(clippy::module_name_repetitions)] #[derive(Deserialize)] #[serde(try_from = "GlobalSpeciationReporterArgs")] pub struct GlobalSpeciationReporter { diff --git a/necsim/plugins/statistics/src/turnover.rs b/necsim/plugins/statistics/src/turnover.rs index 9d6cd106d..7d88cff07 100644 --- a/necsim/plugins/statistics/src/turnover.rs +++ b/necsim/plugins/statistics/src/turnover.rs @@ -14,7 +14,6 @@ use necsim_core::{ reporter::Reporter, }; -#[allow(clippy::module_name_repetitions)] #[derive(Deserialize)] #[serde(try_from = "GlobalTurnoverReporterArgs")] pub struct GlobalTurnoverReporter { diff --git a/necsim/plugins/tskit/build.rs b/necsim/plugins/tskit/build.rs index 3833ff792..0176682e5 100644 --- a/necsim/plugins/tskit/build.rs +++ b/necsim/plugins/tskit/build.rs @@ -19,13 +19,13 @@ use semver::{{BuildMetadata, Prerelease}};\n" writeln!( file, - "#[allow(dead_code)] + "#[expect(dead_code)] /// Returns the `rustc` `SemVer` version. pub fn version() -> Version {{ version_meta().semver }} -#[allow(dead_code)] +#[expect(dead_code)] /// Returns the `rustc` `SemVer` version and additional metadata /// like the git short hash and build date. pub fn version_meta() -> VersionMeta {{ diff --git a/necsim/plugins/tskit/src/provenance.rs b/necsim/plugins/tskit/src/provenance.rs index fbabdf27b..b40dd3cb7 100644 --- a/necsim/plugins/tskit/src/provenance.rs +++ b/necsim/plugins/tskit/src/provenance.rs @@ -4,7 +4,7 @@ use findshlibs::{SharedLibrary, TargetSharedLibrary}; use serde::Serialize; /// tskit's provenance JSON schema format root for version 1.0.0 -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Serialize)] pub struct TskitProvenance { schema_version: String, @@ -73,7 +73,7 @@ impl TskitProvenanceParameters { #[derive(Serialize)] struct TskitProvenanceEnvironment { os: TskitProvenanceEnvironmentOs, - #[allow(clippy::zero_sized_map_values)] + #[expect(clippy::zero_sized_map_values)] libraries: HashMap, #[serde(with = "self::rustc_version::VersionMetaDef")] rustc: ::rustc_version::VersionMeta, @@ -81,7 +81,7 @@ struct TskitProvenanceEnvironment { impl TskitProvenanceEnvironment { pub fn try_new() -> io::Result { - #[allow(clippy::zero_sized_map_values)] + #[expect(clippy::zero_sized_map_values)] let mut libraries = HashMap::new(); // Create a map of all dynamically loaded libraries @@ -126,7 +126,7 @@ impl TskitProvenanceEnvironmentOs { struct TskitProvenanceEnvironmentLibrary {} impl TskitProvenanceEnvironmentLibrary { - #[allow(clippy::unnecessary_wraps)] + #[expect(clippy::unnecessary_wraps)] pub fn try_new(_library: &std::ffi::OsStr) -> io::Result { // TODO: Future work might deduce version information etc. @@ -156,7 +156,7 @@ mod rustc_version { pub llvm_version: Option, } - #[allow(clippy::trivially_copy_pass_by_ref)] + #[expect(clippy::trivially_copy_pass_by_ref)] fn serialize_channel( channel: &Channel, serializer: S, @@ -168,7 +168,6 @@ mod rustc_version { llvm_version: &Option, serializer: S, ) -> Result { - #[allow(clippy::option_if_let_else)] if let Some(llvm_version) = llvm_version { serializer.collect_str(llvm_version) } else { diff --git a/necsim/plugins/tskit/src/tree/metadata.rs b/necsim/plugins/tskit/src/tree/metadata.rs index bb26bfe0b..a7fe71d09 100644 --- a/necsim/plugins/tskit/src/tree/metadata.rs +++ b/necsim/plugins/tskit/src/tree/metadata.rs @@ -4,7 +4,7 @@ use tskit::metadata::{IndividualMetadata, MetadataError, MetadataRoundtrip, Node use necsim_core::lineage::GlobalLineageReference; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[repr(transparent)] pub struct GlobalLineageMetadata(GlobalLineageReference); diff --git a/necsim/plugins/tskit/src/tree/mod.rs b/necsim/plugins/tskit/src/tree/mod.rs index 852caffcc..94ab77ec8 100644 --- a/necsim/plugins/tskit/src/tree/mod.rs +++ b/necsim/plugins/tskit/src/tree/mod.rs @@ -19,7 +19,6 @@ mod table; const TSK_SEQUENCE_MIN: f64 = 0.0_f64; const TSK_SEQUENCE_MAX: f64 = 1.0_f64; -#[allow(clippy::module_name_repetitions)] #[derive(Deserialize)] #[serde(try_from = "TskitTreeReporterArgs")] pub struct TskitTreeReporter { diff --git a/rustcoalescence/algorithms/cuda/cpu-kernel/src/lib.rs b/rustcoalescence/algorithms/cuda/cpu-kernel/src/lib.rs index 8f206ab43..d0758e45c 100644 --- a/rustcoalescence/algorithms/cuda/cpu-kernel/src/lib.rs +++ b/rustcoalescence/algorithms/cuda/cpu-kernel/src/lib.rs @@ -20,7 +20,7 @@ use rust_cuda::lend::RustToCuda; mod link; mod patch; -#[allow(clippy::type_complexity)] +#[expect(clippy::type_complexity)] pub struct SimulationKernelPtx< M: MathsCore + Sync, H: Habitat + RustToCuda + Sync, diff --git a/rustcoalescence/algorithms/cuda/cpu-kernel/src/link.rs b/rustcoalescence/algorithms/cuda/cpu-kernel/src/link.rs index 74635f8bf..bb19c5466 100644 --- a/rustcoalescence/algorithms/cuda/cpu-kernel/src/link.rs +++ b/rustcoalescence/algorithms/cuda/cpu-kernel/src/link.rs @@ -13,7 +13,7 @@ use necsim_impls_no_std::cogs::{ use rust_cuda::lend::RustToCuda; -#[allow(clippy::type_complexity)] +#[expect(clippy::type_complexity)] pub struct SimulationKernelPtx< M: MathsCore + Sync, H: Habitat + RustToCuda + Sync, @@ -48,7 +48,7 @@ pub struct SimulationKernelPtx< )>, ); -#[allow(unused_macros)] +#[allow(unused_macros)] // FIXME: use expect macro_rules! link_kernel { ($habitat:ty, $dispersal:ty, $turnover:ty, $speciation:ty) => { link_kernel! { diff --git a/rustcoalescence/algorithms/cuda/gpu-kernel/src/lib.rs b/rustcoalescence/algorithms/cuda/gpu-kernel/src/lib.rs index 008ad3485..77e646770 100644 --- a/rustcoalescence/algorithms/cuda/gpu-kernel/src/lib.rs +++ b/rustcoalescence/algorithms/cuda/gpu-kernel/src/lib.rs @@ -42,8 +42,7 @@ use rust_cuda::{ allow(ptx::local_memory_use), // FIXME forbid(ptx::register_spills), )] -#[allow(clippy::too_many_arguments)] -#[allow(clippy::type_complexity)] +#[expect(clippy::type_complexity)] pub fn simulate< M: MathsCore + Sync, H: Habitat + RustToCuda + Sync, diff --git a/rustcoalescence/algorithms/cuda/src/arguments.rs b/rustcoalescence/algorithms/cuda/src/arguments.rs index fafc7ef7f..e3de21afe 100644 --- a/rustcoalescence/algorithms/cuda/src/arguments.rs +++ b/rustcoalescence/algorithms/cuda/src/arguments.rs @@ -57,7 +57,7 @@ impl<'de> DeserializeState<'de, PartitionSize> for ParallelismMode { } #[derive(Clone, Debug, Serialize)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct CudaArguments { pub device: u32, pub ptx_jit: bool, diff --git a/rustcoalescence/algorithms/cuda/src/cuda.rs b/rustcoalescence/algorithms/cuda/src/cuda.rs index d8222ebb1..36fa903e2 100644 --- a/rustcoalescence/algorithms/cuda/src/cuda.rs +++ b/rustcoalescence/algorithms/cuda/src/cuda.rs @@ -7,7 +7,7 @@ use rust_cuda::host::CudaDropWrapper; use crate::{error::CudaError, info}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub fn with_initialised_cuda, F: FnOnce() -> Result>( device: u32, inner: F, diff --git a/rustcoalescence/algorithms/cuda/src/error.rs b/rustcoalescence/algorithms/cuda/src/error.rs index f81a9e3c1..085f1ed29 100644 --- a/rustcoalescence/algorithms/cuda/src/error.rs +++ b/rustcoalescence/algorithms/cuda/src/error.rs @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize}; #[derive(thiserror::Error, Debug, Clone, Serialize, Deserialize)] #[serde(into = "CudaErrorRaw", from = "CudaErrorRaw")] #[error(transparent)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct CudaError(#[from] RustaCudaError); #[derive(Serialize, Deserialize)] @@ -25,7 +25,7 @@ impl From for CudaError { fn from(value: CudaErrorRaw) -> Self { type E = RustaCudaError; - #[allow(clippy::wildcard_in_or_patterns)] + #[expect(clippy::wildcard_in_or_patterns)] let code = match value.code { const { E::InvalidValue as u32 } => E::InvalidValue, const { E::OutOfMemory as u32 } => E::OutOfMemory, diff --git a/rustcoalescence/algorithms/cuda/src/initialiser/genesis.rs b/rustcoalescence/algorithms/cuda/src/initialiser/genesis.rs index ce00dc71b..06db5b133 100644 --- a/rustcoalescence/algorithms/cuda/src/initialiser/genesis.rs +++ b/rustcoalescence/algorithms/cuda/src/initialiser/genesis.rs @@ -19,7 +19,7 @@ use crate::CudaError; use super::CudaLineageStoreSampleInitialiser; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct GenesisInitialiser; impl + RustToCuda + Sync, O: Scenario> diff --git a/rustcoalescence/algorithms/cuda/src/initialiser/mod.rs b/rustcoalescence/algorithms/cuda/src/initialiser/mod.rs index 48947d7dd..8ff31f068 100644 --- a/rustcoalescence/algorithms/cuda/src/initialiser/mod.rs +++ b/rustcoalescence/algorithms/cuda/src/initialiser/mod.rs @@ -24,7 +24,7 @@ pub mod fixup; pub mod genesis; pub mod resume; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait CudaLineageStoreSampleInitialiser< M: MathsCore, G: PrimeableRng + RustToCuda + Sync, @@ -53,7 +53,7 @@ pub trait CudaLineageStoreSampleInitialiser< >, NeverImmigrationEntry, > + RustToCuda + Sync; - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] fn init< 'h, T: TrustedOriginSampler<'h, M, Habitat = O::Habitat>, diff --git a/rustcoalescence/algorithms/cuda/src/initialiser/resume.rs b/rustcoalescence/algorithms/cuda/src/initialiser/resume.rs index f48633d76..184492eda 100644 --- a/rustcoalescence/algorithms/cuda/src/initialiser/resume.rs +++ b/rustcoalescence/algorithms/cuda/src/initialiser/resume.rs @@ -22,7 +22,7 @@ use crate::CudaError; use super::CudaLineageStoreSampleInitialiser; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct ResumeInitialiser> { pub lineages: L, pub resume_after: Option, diff --git a/rustcoalescence/algorithms/cuda/src/launch.rs b/rustcoalescence/algorithms/cuda/src/launch.rs index 921da4fc3..693fdbbd3 100644 --- a/rustcoalescence/algorithms/cuda/src/launch.rs +++ b/rustcoalescence/algorithms/cuda/src/launch.rs @@ -48,7 +48,7 @@ use crate::{ parallelisation, }; -#[allow(clippy::too_many_lines)] +#[expect(clippy::too_many_lines)] pub fn initialise_and_simulate< 'p, M: MathsCore + Sync, diff --git a/rustcoalescence/algorithms/cuda/src/lib.rs b/rustcoalescence/algorithms/cuda/src/lib.rs index c19913634..dd8780bc7 100644 --- a/rustcoalescence/algorithms/cuda/src/lib.rs +++ b/rustcoalescence/algorithms/cuda/src/lib.rs @@ -63,7 +63,6 @@ use crate::{ }, }; -#[allow(clippy::module_name_repetitions, clippy::empty_enum)] pub enum CudaAlgorithm {} impl AlgorithmParamters for CudaAlgorithm { diff --git a/rustcoalescence/algorithms/cuda/src/parallelisation/monolithic.rs b/rustcoalescence/algorithms/cuda/src/parallelisation/monolithic.rs index b049d3d9d..2cf4abf9c 100644 --- a/rustcoalescence/algorithms/cuda/src/parallelisation/monolithic.rs +++ b/rustcoalescence/algorithms/cuda/src/parallelisation/monolithic.rs @@ -43,7 +43,7 @@ use crate::error::CudaError; type Result = std::result::Result; -#[allow(clippy::type_complexity, clippy::too_many_lines)] +#[expect(clippy::type_complexity, clippy::too_many_lines)] pub fn simulate< 'l, 'p, @@ -116,7 +116,6 @@ pub fn simulate< let (dedup_cache, step_slice) = config; - #[allow(clippy::or_fun_call)] let intial_max_time = slow_lineages .iter() .map(|(lineage, _)| lineage.last_event_time) @@ -159,7 +158,6 @@ pub fn simulate< let mut min_spec_samples = dedup_cache.construct(slow_lineages.len()); - #[allow(clippy::or_fun_call)] let mut level_time = slow_lineages .iter() .map(|(lineage, _)| lineage.last_event_time) diff --git a/rustcoalescence/algorithms/gillespie/src/arguments.rs b/rustcoalescence/algorithms/gillespie/src/arguments.rs index 910d03f04..dd64e8757 100644 --- a/rustcoalescence/algorithms/gillespie/src/arguments.rs +++ b/rustcoalescence/algorithms/gillespie/src/arguments.rs @@ -9,7 +9,7 @@ use necsim_partitioning_core::{ }; #[derive(Clone, Serialize, Debug)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct GillespieArguments { pub parallelism_mode: ParallelismMode, } diff --git a/rustcoalescence/algorithms/gillespie/src/event_skipping/initialiser/genesis.rs b/rustcoalescence/algorithms/gillespie/src/event_skipping/initialiser/genesis.rs index 790ed2bfc..616eed717 100644 --- a/rustcoalescence/algorithms/gillespie/src/event_skipping/initialiser/genesis.rs +++ b/rustcoalescence/algorithms/gillespie/src/event_skipping/initialiser/genesis.rs @@ -18,7 +18,7 @@ use rustcoalescence_scenarios::Scenario; use super::EventSkippingLineageStoreSampleInitialiser; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct GenesisInitialiser; impl, O: Scenario> diff --git a/rustcoalescence/algorithms/gillespie/src/event_skipping/initialiser/mod.rs b/rustcoalescence/algorithms/gillespie/src/event_skipping/initialiser/mod.rs index 70490f920..ce730a994 100644 --- a/rustcoalescence/algorithms/gillespie/src/event_skipping/initialiser/mod.rs +++ b/rustcoalescence/algorithms/gillespie/src/event_skipping/initialiser/mod.rs @@ -19,7 +19,7 @@ pub mod fixup; pub mod genesis; pub mod resume; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait EventSkippingLineageStoreSampleInitialiser< M: MathsCore, G: RngCore, @@ -56,7 +56,7 @@ pub trait EventSkippingLineageStoreSampleInitialiser< I, >; - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] fn init< 'h, 'p, diff --git a/rustcoalescence/algorithms/gillespie/src/event_skipping/initialiser/resume.rs b/rustcoalescence/algorithms/gillespie/src/event_skipping/initialiser/resume.rs index 9f8e10694..ddac0ed21 100644 --- a/rustcoalescence/algorithms/gillespie/src/event_skipping/initialiser/resume.rs +++ b/rustcoalescence/algorithms/gillespie/src/event_skipping/initialiser/resume.rs @@ -21,7 +21,7 @@ use rustcoalescence_scenarios::Scenario; use super::EventSkippingLineageStoreSampleInitialiser; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct ResumeInitialiser> { pub lineages: L, pub resume_after: Option, diff --git a/rustcoalescence/algorithms/gillespie/src/event_skipping/launch.rs b/rustcoalescence/algorithms/gillespie/src/event_skipping/launch.rs index 8e92f15b0..f70c699af 100644 --- a/rustcoalescence/algorithms/gillespie/src/event_skipping/launch.rs +++ b/rustcoalescence/algorithms/gillespie/src/event_skipping/launch.rs @@ -32,7 +32,7 @@ use crate::arguments::{ AveragingParallelismMode, GillespieArguments, OptimisticParallelismMode, ParallelismMode, }; -#[allow(clippy::shadow_unrelated, clippy::too_many_lines)] +#[expect(clippy::too_many_lines)] pub fn initialise_and_simulate< 'p, M: MathsCore, diff --git a/rustcoalescence/algorithms/gillespie/src/event_skipping/mod.rs b/rustcoalescence/algorithms/gillespie/src/event_skipping/mod.rs index b8f68c957..58a6be0e2 100644 --- a/rustcoalescence/algorithms/gillespie/src/event_skipping/mod.rs +++ b/rustcoalescence/algorithms/gillespie/src/event_skipping/mod.rs @@ -33,7 +33,7 @@ use initialiser::{ fixup::FixUpInitialiser, genesis::GenesisInitialiser, resume::ResumeInitialiser, }; -#[allow(clippy::module_name_repetitions, clippy::empty_enum)] +#[expect(clippy::module_name_repetitions)] pub struct EventSkippingAlgorithm {} impl AlgorithmParamters for EventSkippingAlgorithm { diff --git a/rustcoalescence/algorithms/gillespie/src/gillespie/classical/initialiser/genesis.rs b/rustcoalescence/algorithms/gillespie/src/gillespie/classical/initialiser/genesis.rs index 4b64fb6e0..c1ccc6066 100644 --- a/rustcoalescence/algorithms/gillespie/src/gillespie/classical/initialiser/genesis.rs +++ b/rustcoalescence/algorithms/gillespie/src/gillespie/classical/initialiser/genesis.rs @@ -13,7 +13,7 @@ use rustcoalescence_scenarios::Scenario; use super::ClassicalLineageStoreSampleInitialiser; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct GenesisInitialiser; impl, O: Scenario> diff --git a/rustcoalescence/algorithms/gillespie/src/gillespie/classical/initialiser/mod.rs b/rustcoalescence/algorithms/gillespie/src/gillespie/classical/initialiser/mod.rs index 1f2ea44cf..f36d2f427 100644 --- a/rustcoalescence/algorithms/gillespie/src/gillespie/classical/initialiser/mod.rs +++ b/rustcoalescence/algorithms/gillespie/src/gillespie/classical/initialiser/mod.rs @@ -19,7 +19,7 @@ pub mod fixup; pub mod genesis; pub mod resume; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait ClassicalLineageStoreSampleInitialiser< M: MathsCore, G: RngCore, @@ -56,7 +56,7 @@ pub trait ClassicalLineageStoreSampleInitialiser< I, >; - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] fn init< 'h, 'p, diff --git a/rustcoalescence/algorithms/gillespie/src/gillespie/classical/initialiser/resume.rs b/rustcoalescence/algorithms/gillespie/src/gillespie/classical/initialiser/resume.rs index 42002b0ba..de6bd7b0e 100644 --- a/rustcoalescence/algorithms/gillespie/src/gillespie/classical/initialiser/resume.rs +++ b/rustcoalescence/algorithms/gillespie/src/gillespie/classical/initialiser/resume.rs @@ -16,7 +16,7 @@ use rustcoalescence_scenarios::Scenario; use super::ClassicalLineageStoreSampleInitialiser; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct ResumeInitialiser> { pub lineages: L, pub resume_after: Option, diff --git a/rustcoalescence/algorithms/gillespie/src/gillespie/classical/launch.rs b/rustcoalescence/algorithms/gillespie/src/gillespie/classical/launch.rs index 750102da6..9744c7955 100644 --- a/rustcoalescence/algorithms/gillespie/src/gillespie/classical/launch.rs +++ b/rustcoalescence/algorithms/gillespie/src/gillespie/classical/launch.rs @@ -32,7 +32,7 @@ use crate::arguments::{ use super::initialiser::ClassicalLineageStoreSampleInitialiser; -#[allow(clippy::too_many_lines)] +#[expect(clippy::too_many_lines)] pub fn initialise_and_simulate< 'p, M: MathsCore, diff --git a/rustcoalescence/algorithms/gillespie/src/gillespie/mod.rs b/rustcoalescence/algorithms/gillespie/src/gillespie/mod.rs index 4a9f6c08c..cc782bf68 100644 --- a/rustcoalescence/algorithms/gillespie/src/gillespie/mod.rs +++ b/rustcoalescence/algorithms/gillespie/src/gillespie/mod.rs @@ -17,7 +17,7 @@ use crate::arguments::{get_gillespie_logical_partition_size, GillespieArguments} mod classical; mod turnover; -#[allow(clippy::module_name_repetitions, clippy::empty_enum)] +#[expect(clippy::module_name_repetitions, clippy::empty_enum)] pub enum GillespieAlgorithm {} impl AlgorithmParamters for GillespieAlgorithm { diff --git a/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/initialiser/genesis.rs b/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/initialiser/genesis.rs index 7e111a418..17f75d1a3 100644 --- a/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/initialiser/genesis.rs +++ b/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/initialiser/genesis.rs @@ -16,7 +16,7 @@ use rustcoalescence_scenarios::Scenario; use super::GillespieLineageStoreSampleInitialiser; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct GenesisInitialiser; impl, O: Scenario> diff --git a/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/initialiser/mod.rs b/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/initialiser/mod.rs index 4def88e33..19e70b527 100644 --- a/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/initialiser/mod.rs +++ b/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/initialiser/mod.rs @@ -15,7 +15,7 @@ pub mod fixup; pub mod genesis; pub mod resume; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait GillespieLineageStoreSampleInitialiser< M: MathsCore, G: RngCore, @@ -44,7 +44,7 @@ pub trait GillespieLineageStoreSampleInitialiser< I, >; - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] fn init< 'h, 'p, diff --git a/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/initialiser/resume.rs b/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/initialiser/resume.rs index 596c69bb2..498662a9c 100644 --- a/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/initialiser/resume.rs +++ b/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/initialiser/resume.rs @@ -19,7 +19,7 @@ use rustcoalescence_scenarios::Scenario; use super::GillespieLineageStoreSampleInitialiser; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct ResumeInitialiser> { pub lineages: L, pub resume_after: Option, diff --git a/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/launch.rs b/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/launch.rs index e34dbe25f..688ec5265 100644 --- a/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/launch.rs +++ b/rustcoalescence/algorithms/gillespie/src/gillespie/turnover/launch.rs @@ -31,7 +31,7 @@ use crate::arguments::{ use super::initialiser::GillespieLineageStoreSampleInitialiser; -#[allow(clippy::shadow_unrelated, clippy::too_many_lines)] +#[expect(clippy::too_many_lines)] pub fn initialise_and_simulate< 'p, M: MathsCore, diff --git a/rustcoalescence/algorithms/independent/src/arguments.rs b/rustcoalescence/algorithms/independent/src/arguments.rs index 90422ea43..6c9424473 100644 --- a/rustcoalescence/algorithms/independent/src/arguments.rs +++ b/rustcoalescence/algorithms/independent/src/arguments.rs @@ -77,7 +77,7 @@ impl<'de> DeserializeState<'de, PartitionSize> for ParallelismMode { } #[derive(Clone, Debug, Serialize)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct IndependentArguments { pub delta_t: PositiveF64, pub step_slice: NonZeroU64, diff --git a/rustcoalescence/algorithms/independent/src/initialiser/genesis.rs b/rustcoalescence/algorithms/independent/src/initialiser/genesis.rs index 07b29ee36..272ab2bb0 100644 --- a/rustcoalescence/algorithms/independent/src/initialiser/genesis.rs +++ b/rustcoalescence/algorithms/independent/src/initialiser/genesis.rs @@ -15,7 +15,7 @@ use rustcoalescence_scenarios::Scenario; use super::IndependentLineageStoreSampleInitialiser; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct GenesisInitialiser; impl, O: Scenario> diff --git a/rustcoalescence/algorithms/independent/src/initialiser/mod.rs b/rustcoalescence/algorithms/independent/src/initialiser/mod.rs index e316b87b5..40d369513 100644 --- a/rustcoalescence/algorithms/independent/src/initialiser/mod.rs +++ b/rustcoalescence/algorithms/independent/src/initialiser/mod.rs @@ -20,7 +20,7 @@ pub mod fixup; pub mod genesis; pub mod resume; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait IndependentLineageStoreSampleInitialiser< M: MathsCore, G: PrimeableRng, @@ -42,7 +42,7 @@ pub trait IndependentLineageStoreSampleInitialiser< >, NeverImmigrationEntry, >; - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] fn init< 'h, T: TrustedOriginSampler<'h, M, Habitat = O::Habitat>, diff --git a/rustcoalescence/algorithms/independent/src/initialiser/resume.rs b/rustcoalescence/algorithms/independent/src/initialiser/resume.rs index 6f12db91f..7d0fe698b 100644 --- a/rustcoalescence/algorithms/independent/src/initialiser/resume.rs +++ b/rustcoalescence/algorithms/independent/src/initialiser/resume.rs @@ -18,7 +18,7 @@ use rustcoalescence_scenarios::Scenario; use super::IndependentLineageStoreSampleInitialiser; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct ResumeInitialiser> { pub lineages: L, pub resume_after: Option, diff --git a/rustcoalescence/algorithms/independent/src/launch.rs b/rustcoalescence/algorithms/independent/src/launch.rs index bc645a6dd..ef2c0d36e 100644 --- a/rustcoalescence/algorithms/independent/src/launch.rs +++ b/rustcoalescence/algorithms/independent/src/launch.rs @@ -41,7 +41,7 @@ use crate::{ initialiser::IndependentLineageStoreSampleInitialiser, }; -#[allow(clippy::too_many_lines)] +#[expect(clippy::too_many_lines)] pub fn initialise_and_simulate< 'p, M: MathsCore, diff --git a/rustcoalescence/algorithms/independent/src/lib.rs b/rustcoalescence/algorithms/independent/src/lib.rs index 026d1f1e5..16508bbeb 100644 --- a/rustcoalescence/algorithms/independent/src/lib.rs +++ b/rustcoalescence/algorithms/independent/src/lib.rs @@ -36,7 +36,7 @@ use initialiser::{ fixup::FixUpInitialiser, genesis::GenesisInitialiser, resume::ResumeInitialiser, }; -#[allow(clippy::module_name_repetitions, clippy::empty_enum)] +#[expect(clippy::empty_enum)] pub enum IndependentAlgorithm {} impl AlgorithmParamters for IndependentAlgorithm { diff --git a/rustcoalescence/algorithms/src/lib.rs b/rustcoalescence/algorithms/src/lib.rs index b668ee5e9..c1d639573 100644 --- a/rustcoalescence/algorithms/src/lib.rs +++ b/rustcoalescence/algorithms/src/lib.rs @@ -82,7 +82,7 @@ pub trait Algorithm< /// /// Returns a `ContinueError` if initialising the resuming /// simulation or running the algorithm failed - #[allow(clippy::type_complexity, clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] fn resume_and_simulate, L: ExactSizeIterator>( args: Self::Arguments, rng: G, @@ -98,7 +98,7 @@ pub trait Algorithm< /// /// Returns a `ContinueError` if fixing up the restarting /// simulation (incl. running the algorithm) failed - #[allow(clippy::type_complexity, clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] fn fixup_for_restart, L: ExactSizeIterator>( args: Self::Arguments, rng: G, diff --git a/rustcoalescence/algorithms/src/strategy.rs b/rustcoalescence/algorithms/src/strategy.rs index 879560553..1a841e3d3 100644 --- a/rustcoalescence/algorithms/src/strategy.rs +++ b/rustcoalescence/algorithms/src/strategy.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(default)] pub struct RestartFixUpStrategy { @@ -22,14 +22,14 @@ impl Default for RestartFixUpStrategy { } } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Clone, Debug, Serialize, Deserialize)] pub enum OutOfDemeStrategy { Abort, Dispersal, } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Clone, Debug, Serialize, Deserialize)] pub enum OutOfHabitatStrategy { Abort, @@ -37,7 +37,7 @@ pub enum OutOfHabitatStrategy { UniformDispersal, } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Clone, Debug, Serialize, Deserialize)] pub enum CoalescenceStrategy { Abort, diff --git a/rustcoalescence/scenarios/src/almost_infinite/clark2dt.rs b/rustcoalescence/scenarios/src/almost_infinite/clark2dt.rs index 4a9a48b3c..b09efd71a 100644 --- a/rustcoalescence/scenarios/src/almost_infinite/clark2dt.rs +++ b/rustcoalescence/scenarios/src/almost_infinite/clark2dt.rs @@ -24,12 +24,11 @@ use crate::{Scenario, ScenarioCogs, ScenarioParameters}; use super::Sample; -#[allow(clippy::module_name_repetitions, clippy::empty_enum)] +#[expect(clippy::empty_enum)] #[derive(Debug)] pub enum AlmostInfiniteClark2DtDispersalScenario {} #[derive(Debug, Serialize, Deserialize)] -#[allow(clippy::module_name_repetitions)] #[serde(rename = "AlmostInfiniteClark2DtDispersal")] pub struct AlmostInfiniteClark2DtDispersalArguments { pub sample: Sample, diff --git a/rustcoalescence/scenarios/src/almost_infinite/downscaled.rs b/rustcoalescence/scenarios/src/almost_infinite/downscaled.rs index e1130026d..4e8909f6a 100644 --- a/rustcoalescence/scenarios/src/almost_infinite/downscaled.rs +++ b/rustcoalescence/scenarios/src/almost_infinite/downscaled.rs @@ -25,7 +25,6 @@ use necsim_impls_no_std::{ use crate::{Scenario, ScenarioCogs, ScenarioParameters}; -#[allow(clippy::module_name_repetitions, clippy::empty_enum)] pub struct AlmostInfiniteDownscaledScenario< M: MathsCore, G: RngCore, @@ -53,7 +52,6 @@ fn default_non_self_dispersal() -> NonSelfDispersal { } #[derive(Debug, Serialize, Deserialize)] -#[allow(clippy::module_name_repetitions)] #[serde(rename = "AlmostInfiniteDownscaled")] #[serde(bound = "O::Arguments: serde::Serialize + serde::de::DeserializeOwned")] pub struct AlmostInfiniteDownscaledArguments { diff --git a/rustcoalescence/scenarios/src/almost_infinite/mod.rs b/rustcoalescence/scenarios/src/almost_infinite/mod.rs index 03e7a88c6..3e021b562 100644 --- a/rustcoalescence/scenarios/src/almost_infinite/mod.rs +++ b/rustcoalescence/scenarios/src/almost_infinite/mod.rs @@ -26,7 +26,7 @@ pub mod downscaled; #[cfg(feature = "almost-infinite-normal-dispersal")] pub mod normal; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, Serialize, Deserialize)] #[serde(deny_unknown_fields)] #[serde(rename = "AlmostInfinite")] @@ -38,7 +38,7 @@ pub struct AlmostInfiniteArguments { downscale: Option, } -#[allow(clippy::module_name_repetitions, clippy::empty_enum)] +#[expect(clippy::module_name_repetitions)] pub enum AlmostInfiniteArgumentVariants { #[cfg(feature = "almost-infinite-normal-dispersal")] Normal(normal::AlmostInfiniteNormalDispersalArguments), diff --git a/rustcoalescence/scenarios/src/almost_infinite/normal.rs b/rustcoalescence/scenarios/src/almost_infinite/normal.rs index ecb9a594d..d76fd6653 100644 --- a/rustcoalescence/scenarios/src/almost_infinite/normal.rs +++ b/rustcoalescence/scenarios/src/almost_infinite/normal.rs @@ -24,12 +24,11 @@ use crate::{Scenario, ScenarioCogs, ScenarioParameters}; use super::Sample; -#[allow(clippy::module_name_repetitions, clippy::empty_enum)] +#[expect(clippy::empty_enum)] #[derive(Debug)] pub enum AlmostInfiniteNormalDispersalScenario {} #[derive(Debug, Serialize, Deserialize)] -#[allow(clippy::module_name_repetitions)] #[serde(rename = "AlmostInfiniteNormalDispersal")] pub struct AlmostInfiniteNormalDispersalArguments { pub sample: Sample, diff --git a/rustcoalescence/scenarios/src/lib.rs b/rustcoalescence/scenarios/src/lib.rs index 3f8f48b3f..2868f26a0 100644 --- a/rustcoalescence/scenarios/src/lib.rs +++ b/rustcoalescence/scenarios/src/lib.rs @@ -1,7 +1,7 @@ #![deny(clippy::pedantic)] #![feature(never_type)] -#[allow(unused_imports)] +#[allow(unused_imports)] // FIXME: use expect #[macro_use] extern crate log; diff --git a/rustcoalescence/scenarios/src/non_spatial.rs b/rustcoalescence/scenarios/src/non_spatial.rs index 3becbd0a7..b4ead8f5a 100644 --- a/rustcoalescence/scenarios/src/non_spatial.rs +++ b/rustcoalescence/scenarios/src/non_spatial.rs @@ -19,11 +19,11 @@ use necsim_impls_no_std::{ use crate::{Scenario, ScenarioCogs, ScenarioParameters}; -#[allow(clippy::module_name_repetitions, clippy::empty_enum)] +#[expect(clippy::module_name_repetitions, clippy::empty_enum)] pub enum NonSpatialScenario {} #[derive(Clone, Debug, Serialize, Deserialize)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[serde(deny_unknown_fields)] #[serde(rename = "NonSpatial")] pub struct NonSpatialArguments { diff --git a/rustcoalescence/scenarios/src/spatially_explicit/maps/mod.rs b/rustcoalescence/scenarios/src/spatially_explicit/maps/mod.rs index 0817cbaed..592f8418e 100644 --- a/rustcoalescence/scenarios/src/spatially_explicit/maps/mod.rs +++ b/rustcoalescence/scenarios/src/spatially_explicit/maps/mod.rs @@ -107,7 +107,7 @@ fn fix_habitat_map( if h_before <= 1 { // If there is no turnover, there cannot be habitat at this location // If there is any dispersal from this location, it must be habitat - #[allow(clippy::bool_to_int_with_if)] + #[expect(clippy::bool_to_int_with_if)] let h_fixed = if turnover.map_or(false, |turnover| turnover[(y, x)] == 0.0_f64) { 0 } else if dispersal diff --git a/rustcoalescence/scenarios/src/spatially_explicit/maps/tiff/data_type.rs b/rustcoalescence/scenarios/src/spatially_explicit/maps/tiff/data_type.rs index 19a09d29e..6b2284852 100644 --- a/rustcoalescence/scenarios/src/spatially_explicit/maps/tiff/data_type.rs +++ b/rustcoalescence/scenarios/src/spatially_explicit/maps/tiff/data_type.rs @@ -1,6 +1,6 @@ use tiff::{decoder::DecodingResult, tags::SampleFormat}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait TiffDataType: Clone + std::fmt::Debug diff --git a/rustcoalescence/scenarios/src/spatially_explicit/maps/tiff/mod.rs b/rustcoalescence/scenarios/src/spatially_explicit/maps/tiff/mod.rs index fb32932a3..f72c89a18 100644 --- a/rustcoalescence/scenarios/src/spatially_explicit/maps/tiff/mod.rs +++ b/rustcoalescence/scenarios/src/spatially_explicit/maps/tiff/mod.rs @@ -10,11 +10,11 @@ use necsim_impls_no_std::array2d::Array2D; mod data_type; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub trait TiffDataType: data_type::TiffDataType {} impl TiffDataType for T {} -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] /// Loads a 2D map from TIFF file at `path` with the data type `D`. /// /// This function assumes that normal, non-sparse TIFF files are read. diff --git a/rustcoalescence/scenarios/src/spatially_explicit/mod.rs b/rustcoalescence/scenarios/src/spatially_explicit/mod.rs index 98ade0b32..fcd92238e 100644 --- a/rustcoalescence/scenarios/src/spatially_explicit/mod.rs +++ b/rustcoalescence/scenarios/src/spatially_explicit/mod.rs @@ -5,7 +5,7 @@ mod turnover; feature = "spatially-explicit-uniform-turnover", feature = "spatially-explicit-turnover-map", ))] -#[allow(clippy::module_name_repetitions)] +#[allow(clippy::module_name_repetitions)] // FIXME: use expect pub use turnover::{SpatiallyExplicitArgumentVariants, SpatiallyExplicitArguments}; #[cfg(feature = "spatially-explicit-turnover-map")] diff --git a/rustcoalescence/scenarios/src/spatially_explicit/turnover/map.rs b/rustcoalescence/scenarios/src/spatially_explicit/turnover/map.rs index 32a929b7c..031fd7384 100644 --- a/rustcoalescence/scenarios/src/spatially_explicit/turnover/map.rs +++ b/rustcoalescence/scenarios/src/spatially_explicit/turnover/map.rs @@ -29,7 +29,6 @@ use crate::{Scenario, ScenarioCogs, ScenarioParameters}; use super::super::maps::{self, MapLoadingMode}; -#[allow(clippy::module_name_repetitions, clippy::enum_variant_names)] #[derive(thiserror::Error, displaydoc::Display, Debug)] pub enum SpatiallyExplicitTurnoverMapScenarioError { /// invalid habitat map: no habitable locations @@ -40,7 +39,7 @@ pub enum SpatiallyExplicitTurnoverMapScenarioError { TurnoverMap(InMemoryTurnoverRateError), } -#[allow(clippy::module_name_repetitions, clippy::empty_enum)] +#[expect(clippy::empty_enum)] pub enum SpatiallyExplicitTurnoverMapScenario {} impl ScenarioParameters for SpatiallyExplicitTurnoverMapScenario { @@ -121,7 +120,6 @@ impl> Scenario for SpatiallyExplicitTurnoverMa #[derive(Debug, Deserialize)] #[serde(try_from = "SpatiallyExplicitTurnoverMapArgumentsRaw")] -#[allow(clippy::module_name_repetitions)] pub struct SpatiallyExplicitTurnoverMapArguments { pub habitat_path: PathBuf, pub habitat_map: Array2D, @@ -133,7 +131,7 @@ pub struct SpatiallyExplicitTurnoverMapArguments { } impl SpatiallyExplicitTurnoverMapArguments { - #[allow(clippy::missing_errors_doc)] + #[expect(clippy::missing_errors_doc)] pub fn try_load( habitat_path: PathBuf, dispersal_path: PathBuf, @@ -222,7 +220,6 @@ impl TryFrom for SpatiallyExplicitTurn } #[derive(Debug, Serialize, Deserialize)] -#[allow(clippy::module_name_repetitions)] #[serde(deny_unknown_fields)] #[serde(rename = "SpatiallyExplicitTurnoverMap")] struct SpatiallyExplicitTurnoverMapArgumentsRaw { diff --git a/rustcoalescence/scenarios/src/spatially_explicit/turnover/mod.rs b/rustcoalescence/scenarios/src/spatially_explicit/turnover/mod.rs index 77a3cd21f..47187cb91 100644 --- a/rustcoalescence/scenarios/src/spatially_explicit/turnover/mod.rs +++ b/rustcoalescence/scenarios/src/spatially_explicit/turnover/mod.rs @@ -8,7 +8,6 @@ pub mod map; pub mod uniform; #[derive(Debug, Serialize, Deserialize)] -#[allow(clippy::module_name_repetitions)] #[serde(deny_unknown_fields)] #[serde(rename = "SpatiallyExplicit")] pub struct SpatiallyExplicitArguments { @@ -26,7 +25,6 @@ pub struct SpatiallyExplicitArguments { loading_mode: MapLoadingMode, } -#[allow(clippy::empty_enum)] pub enum SpatiallyExplicitArgumentVariants { #[cfg(feature = "spatially-explicit-uniform-turnover")] UniformTurnover(uniform::SpatiallyExplicitUniformTurnoverArguments), @@ -35,7 +33,7 @@ pub enum SpatiallyExplicitArgumentVariants { } impl SpatiallyExplicitArguments { - #[allow(clippy::missing_errors_doc)] + #[expect(clippy::missing_errors_doc)] pub fn try_load(self) -> Result { match self { #[cfg(feature = "spatially-explicit-uniform-turnover")] diff --git a/rustcoalescence/scenarios/src/spatially_explicit/turnover/uniform.rs b/rustcoalescence/scenarios/src/spatially_explicit/turnover/uniform.rs index 1b7538cfb..030da3b6e 100644 --- a/rustcoalescence/scenarios/src/spatially_explicit/turnover/uniform.rs +++ b/rustcoalescence/scenarios/src/spatially_explicit/turnover/uniform.rs @@ -29,7 +29,6 @@ use crate::{Scenario, ScenarioCogs, ScenarioParameters}; use super::super::maps::{self, MapLoadingMode}; -#[allow(clippy::module_name_repetitions, clippy::enum_variant_names)] #[derive(thiserror::Error, displaydoc::Display, Debug)] pub enum SpatiallyExplicitUniformTurnoverScenarioError { /// invalid habitat map: no habitable locations @@ -38,7 +37,7 @@ pub enum SpatiallyExplicitUniformTurnoverScenarioError { DispersalMap(InMemoryDispersalSamplerError), } -#[allow(clippy::module_name_repetitions, clippy::empty_enum)] +#[expect(clippy::empty_enum)] pub enum SpatiallyExplicitUniformTurnoverScenario {} impl ScenarioParameters for SpatiallyExplicitUniformTurnoverScenario { @@ -118,7 +117,6 @@ impl> Scenario for SpatiallyExplicitUniformTur #[derive(Debug, Deserialize)] #[serde(try_from = "SpatiallyExplicitUniformTurnoverArgumentsRaw")] -#[allow(clippy::module_name_repetitions)] pub struct SpatiallyExplicitUniformTurnoverArguments { pub habitat_path: PathBuf, pub habitat_map: Array2D, @@ -129,7 +127,7 @@ pub struct SpatiallyExplicitUniformTurnoverArguments { } impl SpatiallyExplicitUniformTurnoverArguments { - #[allow(clippy::missing_errors_doc)] + #[expect(clippy::missing_errors_doc)] pub fn try_load( habitat_path: PathBuf, dispersal_path: PathBuf, @@ -203,7 +201,6 @@ impl TryFrom } #[derive(Debug, Serialize, Deserialize)] -#[allow(clippy::module_name_repetitions)] #[serde(deny_unknown_fields)] #[serde(rename = "SpatiallyExplicitUniformTurnover")] struct SpatiallyExplicitUniformTurnoverArgumentsRaw { diff --git a/rustcoalescence/scenarios/src/spatially_implicit.rs b/rustcoalescence/scenarios/src/spatially_implicit.rs index a919b318b..6f7b761ff 100644 --- a/rustcoalescence/scenarios/src/spatially_implicit.rs +++ b/rustcoalescence/scenarios/src/spatially_implicit.rs @@ -21,11 +21,11 @@ use necsim_impls_no_std::{ use crate::{Scenario, ScenarioCogs, ScenarioParameters}; -#[allow(clippy::module_name_repetitions, clippy::empty_enum)] +#[expect(clippy::module_name_repetitions, clippy::empty_enum)] pub enum SpatiallyImplicitScenario {} #[derive(Clone, Debug, Serialize, Deserialize)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[serde(deny_unknown_fields)] #[serde(rename = "SpatiallyImplicit")] pub struct SpatiallyImplicitArguments { diff --git a/rustcoalescence/scenarios/src/wrapping_noise.rs b/rustcoalescence/scenarios/src/wrapping_noise.rs index b04cd597d..7253cdb5a 100644 --- a/rustcoalescence/scenarios/src/wrapping_noise.rs +++ b/rustcoalescence/scenarios/src/wrapping_noise.rs @@ -26,12 +26,12 @@ use necsim_impls_no_std::{ use crate::{Scenario, ScenarioCogs, ScenarioParameters}; -#[allow(clippy::module_name_repetitions, clippy::empty_enum)] +#[expect(clippy::module_name_repetitions, clippy::empty_enum)] #[derive(Clone)] pub enum WrappingNoiseScenario {} #[derive(Clone, Debug, Serialize, Deserialize)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[serde(deny_unknown_fields)] #[serde(rename = "WrappingNoise")] pub struct WrappingNoiseArguments { diff --git a/rustcoalescence/src/args/cli/replay.rs b/rustcoalescence/src/args/cli/replay.rs index 5b650149d..4ebacaa60 100644 --- a/rustcoalescence/src/args/cli/replay.rs +++ b/rustcoalescence/src/args/cli/replay.rs @@ -6,7 +6,7 @@ use necsim_plugins_core::import::{AnyReporterPluginVec, ReporterPluginLibrary}; #[derive(Serialize, Debug)] #[serde(rename = "Replay")] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub struct ReplayArgs { #[serde(rename = "log", alias = "event_log")] pub event_log: EventLogReplay, @@ -15,7 +15,7 @@ pub struct ReplayArgs { } #[derive(Copy, Clone, Debug, Serialize, Deserialize)] -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[serde(deny_unknown_fields)] pub enum ReplayMode { Strict, @@ -96,7 +96,6 @@ impl<'de> Deserialize<'de> for ReplayArgs { } #[derive(Deserialize)] -#[allow(clippy::module_name_repetitions)] #[serde(deny_unknown_fields)] #[serde(rename = "Replay")] struct ReplayArgsRaw { diff --git a/rustcoalescence/src/args/config/algorithm.rs b/rustcoalescence/src/args/config/algorithm.rs index 280bf3298..969998b1d 100644 --- a/rustcoalescence/src/args/config/algorithm.rs +++ b/rustcoalescence/src/args/config/algorithm.rs @@ -35,7 +35,7 @@ pub enum Algorithm { impl Serialize for Algorithm { fn serialize(&self, serializer: S) -> Result { - #[allow(unreachable_patterns, clippy::single_match_else)] + #[allow(unreachable_patterns)] // FIXME: use expect match self { #[cfg(feature = "gillespie-algorithms")] Self::Gillespie(args) => { diff --git a/rustcoalescence/src/args/config/pause.rs b/rustcoalescence/src/args/config/pause.rs index 80a057457..e656d723a 100644 --- a/rustcoalescence/src/args/config/pause.rs +++ b/rustcoalescence/src/args/config/pause.rs @@ -21,7 +21,7 @@ pub struct Pause { pub mode: PauseMode, } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, Serialize, Deserialize)] pub enum PauseMode { Resume, @@ -49,7 +49,7 @@ pub struct ResumeConfig { temp: bool, } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, Serialize)] #[serde(rename = "Pause")] pub struct FuturePause { @@ -85,7 +85,7 @@ impl<'de> DeserializeState<'de, PartitionSize> for Pause { } } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, Deserialize)] #[serde(deny_unknown_fields)] #[serde(rename = "Pause")] diff --git a/rustcoalescence/src/args/config/rng/base32.rs b/rustcoalescence/src/args/config/rng/base32.rs index f65a45f19..6d953379f 100644 --- a/rustcoalescence/src/args/config/rng/base32.rs +++ b/rustcoalescence/src/args/config/rng/base32.rs @@ -2,14 +2,13 @@ use std::{fmt, ops::Deref}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Clone)] #[repr(transparent)] pub struct Base32String(Box<[u8]>); impl Base32String { #[must_use] - #[allow(dead_code)] pub fn new(bytes: &[u8]) -> Self { Self(bytes.to_vec().into_boxed_slice()) } diff --git a/rustcoalescence/src/args/config/rng/mod.rs b/rustcoalescence/src/args/config/rng/mod.rs index de660dcfa..284c66a2e 100644 --- a/rustcoalescence/src/args/config/rng/mod.rs +++ b/rustcoalescence/src/args/config/rng/mod.rs @@ -18,7 +18,6 @@ pub enum Rng> { State(Base32RngState), } -#[allow(dead_code)] pub struct Base32RngState> { rng: G, marker: PhantomData, @@ -84,7 +83,6 @@ impl> From for Base32RngState { impl> Base32RngState { #[must_use] - #[allow(dead_code)] pub fn into(self) -> G { self.rng } diff --git a/rustcoalescence/src/args/config/sample/mod.rs b/rustcoalescence/src/args/config/sample/mod.rs index 4ae056376..a7159105b 100644 --- a/rustcoalescence/src/args/config/sample/mod.rs +++ b/rustcoalescence/src/args/config/sample/mod.rs @@ -30,7 +30,7 @@ impl Default for Sample { } } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Clone, Serialize)] pub enum SampleOrigin { Habitat, @@ -38,7 +38,7 @@ pub enum SampleOrigin { Bincode(LineageFileLoader), } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Debug, Clone, Serialize, Deserialize)] pub enum SampleMode { Genesis, @@ -53,7 +53,7 @@ impl Default for SampleMode { } } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] #[derive(Clone, Debug, Serialize, Deserialize)] pub struct SampleModeRestart { pub after: NonNegativeF64, diff --git a/rustcoalescence/src/args/config/scenario.rs b/rustcoalescence/src/args/config/scenario.rs index 2b8ea1850..061f519e4 100644 --- a/rustcoalescence/src/args/config/scenario.rs +++ b/rustcoalescence/src/args/config/scenario.rs @@ -33,7 +33,7 @@ pub enum Scenario { } impl Serialize for Scenario { - #[allow(unused_variables)] + #[allow(unused_variables)] // FIXME: use expect fn serialize(&self, serializer: S) -> Result { let scenario: ScenarioRaw = match *self { #[cfg(feature = "spatially-explicit-uniform-turnover-scenario")] @@ -74,7 +74,7 @@ impl Serialize for Scenario { Self::WrappingNoise(ref args) => ScenarioRaw::WrappingNoise(args.clone()), }; - #[allow(unreachable_code)] + #[allow(unreachable_code)] // FIXME: use expect scenario.serialize(serializer) } } diff --git a/rustcoalescence/src/args/utils/parse.rs b/rustcoalescence/src/args/utils/parse.rs index 9ca6670f6..9406f3687 100644 --- a/rustcoalescence/src/args/utils/parse.rs +++ b/rustcoalescence/src/args/utils/parse.rs @@ -3,7 +3,7 @@ use ron::{extensions::Extensions, ser::PrettyConfig, Options}; use serde::{Deserialize, Serialize}; use serde_state::DeserializeState; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub fn try_parse<'de, D: Deserialize<'de>>(subcommand: &str, ron_args: &'de str) -> Result { try_parse_inner(subcommand, ron_args, |de| D::deserialize(de)) } diff --git a/rustcoalescence/src/args/utils/ser/impl.rs b/rustcoalescence/src/args/utils/ser/impl.rs index 8e0b782c8..2534b6703 100644 --- a/rustcoalescence/src/args/utils/ser/impl.rs +++ b/rustcoalescence/src/args/utils/ser/impl.rs @@ -520,7 +520,7 @@ impl Serializer for BufferingSerializer { } impl Serialize for BufferingSerialize { - #[allow(clippy::too_many_lines)] + #[expect(clippy::too_many_lines)] fn serialize(&self, serializer: S) -> Result { match self { Self::Bool(v) => serializer.serialize_bool(*v), diff --git a/rustcoalescence/src/cli/replay.rs b/rustcoalescence/src/cli/replay.rs index c7b7d09c7..7a8dd66ca 100644 --- a/rustcoalescence/src/cli/replay.rs +++ b/rustcoalescence/src/cli/replay.rs @@ -10,7 +10,7 @@ use crate::args::{ utils::parse::{try_parse, try_print}, }; -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub fn replay_with_logger(replay_args: CommandArgs) -> Result<()> { log::set_max_level(LevelFilter::Info); diff --git a/rustcoalescence/src/cli/simulate/dispatch/fallback.rs b/rustcoalescence/src/cli/simulate/dispatch/fallback.rs index 08ba424e8..0db45828f 100644 --- a/rustcoalescence/src/cli/simulate/dispatch/fallback.rs +++ b/rustcoalescence/src/cli/simulate/dispatch/fallback.rs @@ -11,7 +11,7 @@ use crate::{ use super::super::BufferingSimulateArgsBuilder; -#[allow(clippy::too_many_arguments, clippy::needless_pass_by_value)] +#[expect(clippy::too_many_arguments, clippy::needless_pass_by_value)] pub(in super::super) fn dispatch( _partitioning: Partitioning, _event_log: Option, diff --git a/rustcoalescence/src/cli/simulate/dispatch/valid/algorithm_scenario.rs b/rustcoalescence/src/cli/simulate/dispatch/valid/algorithm_scenario.rs index d2e6e4760..6053e63aa 100644 --- a/rustcoalescence/src/cli/simulate/dispatch/valid/algorithm_scenario.rs +++ b/rustcoalescence/src/cli/simulate/dispatch/valid/algorithm_scenario.rs @@ -123,7 +123,7 @@ macro_rules! match_scenario_algorithm { }; } -#[allow(clippy::too_many_arguments, clippy::too_many_lines)] +#[expect(clippy::too_many_arguments, clippy::too_many_lines)] pub(super) fn dispatch>( partitioning: Partitioning, event_log: Option, diff --git a/rustcoalescence/src/cli/simulate/dispatch/valid/info.rs b/rustcoalescence/src/cli/simulate/dispatch/valid/info.rs index 14468e05a..da2d569d4 100644 --- a/rustcoalescence/src/cli/simulate/dispatch/valid/info.rs +++ b/rustcoalescence/src/cli/simulate/dispatch/valid/info.rs @@ -24,8 +24,7 @@ use crate::args::{ use super::{super::super::BufferingSimulateArgsBuilder, partitioning}; -#[allow(dead_code)] -#[allow(clippy::too_many_arguments, clippy::too_many_lines)] +#[expect(clippy::too_many_arguments, clippy::too_many_lines)] pub(super) fn dispatch< M: MathsCore, G: RngCore, diff --git a/rustcoalescence/src/cli/simulate/dispatch/valid/mod.rs b/rustcoalescence/src/cli/simulate/dispatch/valid/mod.rs index eafd3e412..3c6acfb51 100644 --- a/rustcoalescence/src/cli/simulate/dispatch/valid/mod.rs +++ b/rustcoalescence/src/cli/simulate/dispatch/valid/mod.rs @@ -18,7 +18,7 @@ mod partitioning; mod reporter; mod rng; -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] pub(in super::super) fn dispatch( partitioning: Partitioning, event_log: Option, diff --git a/rustcoalescence/src/cli/simulate/dispatch/valid/partitioning.rs b/rustcoalescence/src/cli/simulate/dispatch/valid/partitioning.rs index 2d47aff09..883e46ef9 100644 --- a/rustcoalescence/src/cli/simulate/dispatch/valid/partitioning.rs +++ b/rustcoalescence/src/cli/simulate/dispatch/valid/partitioning.rs @@ -19,7 +19,7 @@ use crate::{ use super::launch; -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] pub(super) fn dispatch< M: MathsCore, G: RngCore, diff --git a/rustcoalescence/src/cli/simulate/dispatch/valid/reporter.rs b/rustcoalescence/src/cli/simulate/dispatch/valid/reporter.rs index 4f30bdc81..5010d95ef 100644 --- a/rustcoalescence/src/cli/simulate/dispatch/valid/reporter.rs +++ b/rustcoalescence/src/cli/simulate/dispatch/valid/reporter.rs @@ -12,7 +12,7 @@ use crate::{ use super::{super::super::BufferingSimulateArgsBuilder, algorithm_scenario}; -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] pub(super) fn dispatch( partitioning: Partitioning, event_log: Option, diff --git a/rustcoalescence/src/cli/simulate/dispatch/valid/rng.rs b/rustcoalescence/src/cli/simulate/dispatch/valid/rng.rs index a1fa2343b..9a39af8d4 100644 --- a/rustcoalescence/src/cli/simulate/dispatch/valid/rng.rs +++ b/rustcoalescence/src/cli/simulate/dispatch/valid/rng.rs @@ -28,7 +28,7 @@ use super::{ info, }; -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] pub(super) fn dispatch< M: MathsCore, G: RngCore, diff --git a/rustcoalescence/src/cli/simulate/mod.rs b/rustcoalescence/src/cli/simulate/mod.rs index 604f8c0ce..fd388a152 100644 --- a/rustcoalescence/src/cli/simulate/mod.rs +++ b/rustcoalescence/src/cli/simulate/mod.rs @@ -13,7 +13,7 @@ mod pause; use dispatch::dispatch; -#[allow(dead_code)] +#[allow(dead_code)] // FIXME: use expect enum SimulationOutcome { Done { time: NonNegativeF64, @@ -26,7 +26,7 @@ enum SimulationOutcome { }, } -#[allow(clippy::module_name_repetitions)] +#[expect(clippy::module_name_repetitions)] pub fn simulate_with_logger(simulate_args: CommandArgs) -> anyhow::Result<()> { log::set_max_level(LevelFilter::Info); diff --git a/rustcoalescence/src/cli/simulate/parse/fields.rs b/rustcoalescence/src/cli/simulate/parse/fields.rs index 2949ef5a9..c59812f43 100644 --- a/rustcoalescence/src/cli/simulate/parse/fields.rs +++ b/rustcoalescence/src/cli/simulate/parse/fields.rs @@ -14,7 +14,7 @@ pub fn parse_and_normalise(ron_args: &str) -> anyhow::Result<()> { #[derive(Deserialize)] #[serde(deny_unknown_fields)] #[serde(rename = "Simulate")] -#[allow(dead_code)] +#[expect(dead_code)] struct SimulateArgsFields { #[serde(alias = "speciation_probability_per_generation")] speciation: IgnoredAny, diff --git a/rustcoalescence/src/cli/simulate/parse/rng.rs b/rustcoalescence/src/cli/simulate/parse/rng.rs index 96d165663..815ab09a5 100644 --- a/rustcoalescence/src/cli/simulate/parse/rng.rs +++ b/rustcoalescence/src/cli/simulate/parse/rng.rs @@ -5,7 +5,7 @@ use crate::args::{config::rng::Rng, utils::parse::try_parse_state}; use super::super::BufferingSimulateArgsBuilder; -#[allow(dead_code)] +#[allow(dead_code)] // FIXME: use expect pub(in super::super) fn parse_and_normalise>( ron_args: &str, normalised_args: &mut BufferingSimulateArgsBuilder, diff --git a/rustcoalescence/src/reporter.rs b/rustcoalescence/src/reporter.rs index d3490b627..818df4c9c 100644 --- a/rustcoalescence/src/reporter.rs +++ b/rustcoalescence/src/reporter.rs @@ -27,7 +27,6 @@ impl DynamicReporterContext { - #[allow(dead_code)] pub fn new( reporter: ReporterPluginVec, ) -> Self { @@ -63,7 +62,7 @@ impl { Monolithic(::FinalisableReporter), #[cfg(feature = "mpi-partitioning")]