| error: using a `Mutex` where an atomic would do |
| --> tests/ui/mutex_atomic.rs:8:13 |
| | |
| LL | let _ = Mutex::new(true); |
| | ^^^^^^^^^^^^^^^^ help: try: `std::sync::atomic::AtomicBool::new(true)` |
| | |
| = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| = note: `-D clippy::mutex-atomic` implied by `-D warnings` |
| = help: to override `-D warnings` add `#[allow(clippy::mutex_atomic)]` |
| |
| error: using a `Mutex` where an atomic would do |
| --> tests/ui/mutex_atomic.rs:11:13 |
| | |
| LL | let _ = Mutex::new(5usize); |
| | ^^^^^^^^^^^^^^^^^^ help: try: `std::sync::atomic::AtomicUsize::new(5usize)` |
| | |
| = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| |
| error: using a `Mutex` where an atomic would do |
| --> tests/ui/mutex_atomic.rs:14:13 |
| | |
| LL | let _ = Mutex::new(9isize); |
| | ^^^^^^^^^^^^^^^^^^ help: try: `std::sync::atomic::AtomicIsize::new(9isize)` |
| | |
| = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| |
| error: using a `Mutex` where an atomic would do |
| --> tests/ui/mutex_atomic.rs:21:13 |
| | |
| LL | let _ = Mutex::new(&mut x as *mut u32); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::sync::atomic::AtomicPtr::new(&mut x as *mut u32)` |
| | |
| = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| |
| error: using a `Mutex` where an atomic would do |
| --> tests/ui/mutex_atomic.rs:24:13 |
| | |
| LL | let _ = Mutex::new(0u32); |
| | ^^^^^^^^^^^^^^^^ help: try: `std::sync::atomic::AtomicU32::new(0u32)` |
| | |
| = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| = note: `-D clippy::mutex-integer` implied by `-D warnings` |
| = help: to override `-D warnings` add `#[allow(clippy::mutex_integer)]` |
| |
| error: using a `Mutex` where an atomic would do |
| --> tests/ui/mutex_atomic.rs:27:13 |
| | |
| LL | let _ = Mutex::new(0i32); |
| | ^^^^^^^^^^^^^^^^ help: try: `std::sync::atomic::AtomicI32::new(0i32)` |
| | |
| = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| |
| error: using a `Mutex` where an atomic would do |
| --> tests/ui/mutex_atomic.rs:31:13 |
| | |
| LL | let _ = Mutex::new(0u8); |
| | ^^^^^^^^^^^^^^^ help: try: `std::sync::atomic::AtomicU8::new(0u8)` |
| | |
| = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| |
| error: using a `Mutex` where an atomic would do |
| --> tests/ui/mutex_atomic.rs:34:13 |
| | |
| LL | let _ = Mutex::new(0i16); |
| | ^^^^^^^^^^^^^^^^ help: try: `std::sync::atomic::AtomicI16::new(0i16)` |
| | |
| = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| |
| error: using a `Mutex` where an atomic would do |
| --> tests/ui/mutex_atomic.rs:37:25 |
| | |
| LL | let _x: Mutex<i8> = Mutex::new(0); |
| | ^^^^^^^^^^^^^ |
| | |
| = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| help: try |
| | |
| LL - let _x: Mutex<i8> = Mutex::new(0); |
| LL + let _x = std::sync::atomic::AtomicI8::new(0); |
| | |
| |
| error: using a `Mutex` where an atomic would do |
| --> tests/ui/mutex_atomic.rs:41:13 |
| | |
| LL | let _ = Mutex::new(X); |
| | ^^^^^^^^^^^^^ help: try: `std::sync::atomic::AtomicI64::new(X)` |
| | |
| = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| |
| error: using a `Mutex` where an atomic would do |
| --> tests/ui/mutex_atomic.rs:53:30 |
| | |
| LL | static MTX: Mutex<u32> = Mutex::new(0); |
| | ^^^^^^^^^^^^^ |
| | |
| = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| help: try |
| | |
| LL - static MTX: Mutex<u32> = Mutex::new(0); |
| LL + static MTX: std::sync::atomic::AtomicU32 = std::sync::atomic::AtomicU32::new(0); |
| | |
| |
| error: using a `Mutex` where an atomic would do |
| --> tests/ui/mutex_atomic.rs:56:15 |
| | |
| LL | let mtx = Mutex::new(0); |
| | ^^^^^^^^^^^^^ help: try: `std::sync::atomic::AtomicI32::new(0)` |
| | |
| = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| |
| error: using a `Mutex` where an atomic would do |
| --> tests/ui/mutex_atomic.rs:60:22 |
| | |
| LL | let reassigned = mtx; |
| | ^^^ |
| | |
| = help: consider using an `AtomicI32` instead |
| = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| |
| error: using a `Mutex` where an atomic would do |
| --> tests/ui/mutex_atomic.rs:65:35 |
| | |
| LL | let (funky_mtx): Mutex<u64> = Mutex::new(0); |
| | ^^^^^^^^^^^^^ |
| | |
| = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| help: try |
| | |
| LL - let (funky_mtx): Mutex<u64> = Mutex::new(0); |
| LL + let (funky_mtx) = std::sync::atomic::AtomicU64::new(0); |
| | |
| |
| error: aborting due to 14 previous errors |
| |