Skip to content

Commit

Permalink
Suppress a Clippy false alarm.
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers committed Jul 5, 2023
1 parent 5b3d89a commit 7a7867a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ impl<T: ?Sized> Clone for Mutex<T> {

impl<T> Mutex<T> {
/// Create a new `Mutex` in the unlocked state.
// Clippy doesn't like Arc around a non-Send field. But Mutex's access
// rules make it Send, which is why we need Arc instead of Rc.
#[allow(clippy::arc_with_non_send_sync)]
pub fn new(t: T) -> Mutex<T> {
let mutex_data = MutexData {
owned: false,
Expand Down
3 changes: 3 additions & 0 deletions src/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ impl<T: ?Sized> Clone for RwLock<T> {

impl<T> RwLock<T> {
/// Create a new `RwLock` in the unlocked state.
// Clippy doesn't like Arc around a non-Send field. But Mutex's access
// rules make it Send, which is why we need Arc instead of Rc.
#[allow(clippy::arc_with_non_send_sync)]
pub fn new(t: T) -> RwLock<T> {
let lock_data = RwLockData {
exclusive: false,
Expand Down

0 comments on commit 7a7867a

Please sign in to comment.