diff --git a/clippy.toml b/clippy.toml index 7d2bbf4515e..2d8b9dd506f 100644 --- a/clippy.toml +++ b/clippy.toml @@ -13,4 +13,6 @@ disallowed-methods = [ disallowed-types = [ { path = "std::collections::HashMap", reason = "compiler data is trusted; use fxhash::FxHashMap (or the crate HashMap alias) to avoid RandomState overhead" }, { path = "std::collections::HashSet", reason = "compiler data is trusted; use fxhash::FxHashSet (or the crate HashSet alias) to avoid RandomState overhead" }, + { path = "std::cell::RefCell", reason = "state is owned and passed explicitly: take &mut, return results, or key caches by all their inputs instead of mutating shared state behind shared references" }, + { path = "std::cell::Cell", reason = "state is owned and passed explicitly: take &mut, return results, or key caches by all their inputs instead of mutating shared state behind shared references" }, ] diff --git a/crates/celox-sv-analyzer/src/lib.rs b/crates/celox-sv-analyzer/src/lib.rs index 544bbcd5c38..7ab3c3ceed6 100644 --- a/crates/celox-sv-analyzer/src/lib.rs +++ b/crates/celox-sv-analyzer/src/lib.rs @@ -2,7 +2,8 @@ test, allow( clippy::disallowed_macros, - reason = "thread-local counters exist only in unit tests; non-test library builds enforce the ban" + clippy::disallowed_types, + reason = "thread-local counters and their cells exist only in unit tests; non-test library builds enforce the bans" ) )] //! SystemVerilog analyzer for Celox. diff --git a/crates/celox-vpi/src/lib.rs b/crates/celox-vpi/src/lib.rs index 412fadba113..46861a550b6 100644 --- a/crates/celox-vpi/src/lib.rs +++ b/crates/celox-vpi/src/lib.rs @@ -9,6 +9,10 @@ not(any(target_arch = "x86_64", target_arch = "aarch64")), allow(dead_code) )] +#![allow( + clippy::disallowed_types, + reason = "VPI callbacks re-enter the layer from C while it holds the simulation, so its state is shared behind the C boundary" +)] #[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))] compile_error!("celox-vpi currently supports only x86-64 and AArch64");