Skip to content

Commit

Permalink
Merge pull request #49 from asomers/clippy
Browse files Browse the repository at this point in the history
Run Clippy in CI
  • Loading branch information
asomers authored Nov 19, 2021
2 parents 27b60a8 + 3ef4bcd commit 6482b1a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ test_task:
- if rustc --version | grep -q nightly; then
- cargo doc --all-features --no-deps
- fi
clippy_script:
- if rustc --version | grep -q nightly; then
- cargo clippy --all-features --all-targets
- fi
before_cache_script: rm -rf $CARGO_HOME/registry/index

codecov_task:
Expand Down
6 changes: 6 additions & 0 deletions src/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ impl<T: ?Sized> Clone for MutexWeak<T> {
}
}

// Clippy doesn't like the Arc within Inner. But the access rules of the Mutex
// make it safe to send. std::sync::Mutex has the same Send impl
#[allow(clippy::non_send_fields_in_send_ty)]
unsafe impl<T: ?Sized + Send> Send for MutexWeak<T> {}
unsafe impl<T: ?Sized + Send> Sync for MutexWeak<T> {}

Expand Down Expand Up @@ -424,6 +427,9 @@ impl<T: 'static + ?Sized> Mutex<T> {
}
}

// Clippy doesn't like the Arc within Inner. But the access rules of the Mutex
// make it safe to send. std::sync::Mutex has the same Send impl
#[allow(clippy::non_send_fields_in_send_ty)]
unsafe impl<T: ?Sized + Send> Send for Mutex<T> {}
unsafe impl<T: ?Sized + Send> Sync for Mutex<T> {}

Expand Down
3 changes: 3 additions & 0 deletions src/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,9 @@ impl<T: 'static + ?Sized> RwLock<T> {
}
}

// Clippy doesn't like the Arc within Inner. But the access rules of the RwLock
// make it safe to send. std::sync::RwLock has the same Send impl
#[allow(clippy::non_send_fields_in_send_ty)]
unsafe impl<T: ?Sized + Send> Send for RwLock<T> {}
unsafe impl<T: ?Sized + Send + Sync> Sync for RwLock<T> {}

Expand Down

0 comments on commit 6482b1a

Please sign in to comment.