Skip to content

Commit

Permalink
chore: fix spurious clippy warning
Browse files Browse the repository at this point in the history
warning: a `const` item should not be interior mutable
  --> src/unbounded.rs:44:5
   |
44 | /     const UNINIT: Slot<T> = Slot {
45 | |         value: UnsafeCell::new(MaybeUninit::uninit()),
46 | |         state: AtomicUsize::new(0),
47 | |     };
   | |______^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
   = note: `#[warn(clippy::declare_interior_mutable_const)]` on by default
  • Loading branch information
fogti committed Oct 29, 2024
1 parent 9c906a2 commit 4ecde29
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/unbounded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ struct Slot<T> {

impl<T> Slot<T> {
#[cfg(not(loom))]
#[allow(clippy::declare_interior_mutable_const)]
const UNINIT: Slot<T> = Slot {
value: UnsafeCell::new(MaybeUninit::uninit()),
state: AtomicUsize::new(0),
Expand Down

0 comments on commit 4ecde29

Please sign in to comment.