File tree Expand file tree Collapse file tree 4 files changed +8
-5
lines changed
crossbeam-utils/src/atomic Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -71,3 +71,7 @@ unexpected_cfgs = { level = "warn", check-cfg = [
71
71
' cfg(crossbeam_loom)' ,
72
72
' cfg(crossbeam_sanitize)' ,
73
73
] }
74
+
75
+ [workspace .lints .clippy ]
76
+ # Suppress buggy or noisy clippy lints
77
+ declare_interior_mutable_const = { level = " allow" , priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/7665
Original file line number Diff line number Diff line change @@ -687,7 +687,7 @@ macro_rules! crossbeam_channel_internal {
687
687
const _LEN: usize = $crate:: crossbeam_channel_internal!( @count ( $( $cases) * ) ) ;
688
688
let _handle: & dyn $crate:: internal:: SelectHandle = & $crate:: never:: <( ) >( ) ;
689
689
690
- #[ allow( unused_mut) ]
690
+ #[ allow( unused_mut, clippy :: zero_repeat_side_effects ) ]
691
691
let mut _sel = [ ( _handle, 0 , :: std:: ptr:: null( ) ) ; _LEN] ;
692
692
693
693
$crate:: crossbeam_channel_internal!(
Original file line number Diff line number Diff line change 91
91
//! A solution to the above is to have the implementation wrap
92
92
//! each value in a lock. However, this has some repercussions:
93
93
//! * The map would no longer be lock-free, inhibiting scalability
94
- //! and allowing for deadlocks.
94
+ //! and allowing for deadlocks.
95
95
//! * If a user of the map doesn't need mutable access, then they pay
96
- //! the price of locks without actually needing them.
96
+ //! the price of locks without actually needing them.
97
97
//!
98
98
//! Instead, the approach taken by this crate gives more control to the user.
99
99
//! If mutable access is needed, then you can use interior mutability,
150
150
//! Crossbeam [does not currently provide a concurrent unordered map](https://github.com/crossbeam-rs/rfcs/issues/32).
151
151
//! That said, here are some other crates which may suit you:
152
152
//! * [`DashMap`](https://docs.rs/dashmap) implements a novel concurrent hash map
153
- //! with good performance characteristics.
153
+ //! with good performance characteristics.
154
154
//! * [`flurry`](https://docs.rs/flurry) is a Rust port of Java's `ConcurrentHashMap`.
155
155
//!
156
156
//! [`insert`]: SkipMap::insert
Original file line number Diff line number Diff line change @@ -1000,7 +1000,6 @@ fn lock(addr: usize) -> &'static SeqLock {
1000
1000
// stored at addresses that are multiples of 3. It'd be too bad if `LEN` was divisible by 3.
1001
1001
// In order to protect from such cases, we simply choose a large prime number for `LEN`.
1002
1002
const LEN : usize = 67 ;
1003
- #[ allow( clippy:: declare_interior_mutable_const) ]
1004
1003
const L : CachePadded < SeqLock > = CachePadded :: new ( SeqLock :: new ( ) ) ;
1005
1004
static LOCKS : [ CachePadded < SeqLock > ; LEN ] = [ L ; LEN ] ;
1006
1005
You can’t perform that action at this time.
0 commit comments