Skip to content

Commit

Permalink
Fix all warnings from the latest Clippy (#1123)
Browse files Browse the repository at this point in the history
  • Loading branch information
powergee authored Jul 16, 2024
1 parent 407375c commit 2a82b61
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,7 @@ unexpected_cfgs = { level = "warn", check-cfg = [
] }
unreachable_pub = "warn"
# unsafe_op_in_unsafe_fn = "warn" # Set at crate-level instead since https://github.com/rust-lang/rust/pull/100081 is not available on MSRV

[workspace.lints.clippy]
# Suppress buggy or noisy clippy lints
declare_interior_mutable_const = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/7665
2 changes: 1 addition & 1 deletion crossbeam-channel/src/select_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ macro_rules! crossbeam_channel_internal {
const _LEN: usize = $crate::crossbeam_channel_internal!(@count ($($cases)*));
let _handle: &dyn $crate::internal::SelectHandle = &$crate::never::<()>();

#[allow(unused_mut)]
#[allow(unused_mut, clippy::zero_repeat_side_effects)]
let mut _sel = [(_handle, 0, ::std::ptr::null()); _LEN];

$crate::crossbeam_channel_internal!(
Expand Down
6 changes: 3 additions & 3 deletions crossbeam-skiplist/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@
//! A solution to the above is to have the implementation wrap
//! each value in a lock. However, this has some repercussions:
//! * The map would no longer be lock-free, inhibiting scalability
//! and allowing for deadlocks.
//! and allowing for deadlocks.
//! * If a user of the map doesn't need mutable access, then they pay
//! the price of locks without actually needing them.
//! the price of locks without actually needing them.
//!
//! Instead, the approach taken by this crate gives more control to the user.
//! If mutable access is needed, then you can use interior mutability,
Expand Down Expand Up @@ -150,7 +150,7 @@
//! Crossbeam [does not currently provide a concurrent unordered map](https://github.com/crossbeam-rs/rfcs/issues/32).
//! That said, here are some other crates which may suit you:
//! * [`DashMap`](https://docs.rs/dashmap) implements a novel concurrent hash map
//! with good performance characteristics.
//! with good performance characteristics.
//! * [`flurry`](https://docs.rs/flurry) is a Rust port of Java's `ConcurrentHashMap`.
//!
//! [`insert`]: SkipMap::insert
Expand Down
1 change: 0 additions & 1 deletion crossbeam-utils/src/atomic/atomic_cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,6 @@ fn lock(addr: usize) -> &'static SeqLock {
// stored at addresses that are multiples of 3. It'd be too bad if `LEN` was divisible by 3.
// In order to protect from such cases, we simply choose a large prime number for `LEN`.
const LEN: usize = 67;
#[allow(clippy::declare_interior_mutable_const)]
const L: CachePadded<SeqLock> = CachePadded::new(SeqLock::new());
static LOCKS: [CachePadded<SeqLock>; LEN] = [L; LEN];

Expand Down

0 comments on commit 2a82b61

Please sign in to comment.