mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
mutex_atomic: Correct location of AtomicBool and friends
The AtomicBool, AtomicUsize, and friends, types live in the `std::sync::atomic` module, rather than `std::atomic` as the lint help text used to say.
This commit is contained in:
parent
691e5e76d3
commit
5875ba3364
@ -22,7 +22,7 @@ use crate::utils::{match_type, paths, span_lint};
|
||||
///
|
||||
/// **Why is this bad?** Using a mutex just to make access to a plain bool or
|
||||
/// reference sequential is shooting flies with cannons.
|
||||
/// `std::atomic::AtomicBool` and `std::atomic::AtomicPtr` are leaner and
|
||||
/// `std::sync::atomic::AtomicBool` and `std::sync::atomic::AtomicPtr` are leaner and
|
||||
/// faster.
|
||||
///
|
||||
/// **Known problems:** This lint cannot detect if the mutex is actually used
|
||||
@ -43,7 +43,7 @@ declare_clippy_lint! {
|
||||
///
|
||||
/// **Why is this bad?** Using a mutex just to make access to a plain integer
|
||||
/// sequential is
|
||||
/// shooting flies with cannons. `std::atomic::usize` is leaner and faster.
|
||||
/// shooting flies with cannons. `std::sync::atomic::AtomicUsize` is leaner and faster.
|
||||
///
|
||||
/// **Known problems:** This lint cannot detect if the mutex is actually used
|
||||
/// for waiting before a critical section.
|
||||
|
Loading…
Reference in New Issue
Block a user