11error: using a `Mutex` where an atomic would do
2- --> tests/ui/mutex_atomic.rs:7:5
2+ --> tests/ui/mutex_atomic.rs:8:13
33 |
4- LL | Mutex::new(true);
5- | ^^^^^^^^^^^^^^^^
4+ LL | let _ = Mutex::new(true);
5+ | ^^^^^^^^^^^^^^^^
66 |
77 = help: consider using an `AtomicBool` instead
88 = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>`
99 = note: `-D clippy::mutex-atomic` implied by `-D warnings`
1010 = help: to override `-D warnings` add `#[allow(clippy::mutex_atomic)]`
1111
1212error: using a `Mutex` where an atomic would do
13- --> tests/ui/mutex_atomic.rs:10:5
13+ --> tests/ui/mutex_atomic.rs:11:13
1414 |
15- LL | Mutex::new(5usize);
16- | ^^^^^^^^^^^^^^^^^^
15+ LL | let _ = Mutex::new(5usize);
16+ | ^^^^^^^^^^^^^^^^^^
1717 |
1818 = help: consider using an `AtomicUsize` instead
1919 = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>`
2020
2121error: using a `Mutex` where an atomic would do
22- --> tests/ui/mutex_atomic.rs:13:5
22+ --> tests/ui/mutex_atomic.rs:14:13
2323 |
24- LL | Mutex::new(9isize);
25- | ^^^^^^^^^^^^^^^^^^
24+ LL | let _ = Mutex::new(9isize);
25+ | ^^^^^^^^^^^^^^^^^^
2626 |
2727 = help: consider using an `AtomicIsize` instead
2828 = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>`
2929
3030error: using a `Mutex` where an atomic would do
31- --> tests/ui/mutex_atomic.rs:17:5
31+ --> tests/ui/mutex_atomic.rs:18:13
3232 |
33- LL | Mutex::new(&x as *const u32);
34- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33+ LL | let _ = Mutex::new(&x as *const u32);
34+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3535 |
3636 = help: consider using an `AtomicPtr` instead
3737 = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>`
3838
3939error: using a `Mutex` where an atomic would do
40- --> tests/ui/mutex_atomic.rs:20:5
40+ --> tests/ui/mutex_atomic.rs:21:13
4141 |
42- LL | Mutex::new(&mut x as *mut u32);
43- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42+ LL | let _ = Mutex::new(&mut x as *mut u32);
43+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4444 |
4545 = help: consider using an `AtomicPtr` instead
4646 = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>`
4747
4848error: using a `Mutex` where an atomic would do
49- --> tests/ui/mutex_atomic.rs:23:5
49+ --> tests/ui/mutex_atomic.rs:24:13
5050 |
51- LL | Mutex::new(0u32);
52- | ^^^^^^^^^^^^^^^^
51+ LL | let _ = Mutex::new(0u32);
52+ | ^^^^^^^^^^^^^^^^
5353 |
5454 = help: consider using an `AtomicU32` instead
5555 = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>`
5656 = note: `-D clippy::mutex-integer` implied by `-D warnings`
5757 = help: to override `-D warnings` add `#[allow(clippy::mutex_integer)]`
5858
5959error: using a `Mutex` where an atomic would do
60- --> tests/ui/mutex_atomic.rs:26:5
60+ --> tests/ui/mutex_atomic.rs:27:13
6161 |
62- LL | Mutex::new(0i32);
63- | ^^^^^^^^^^^^^^^^
62+ LL | let _ = Mutex::new(0i32);
63+ | ^^^^^^^^^^^^^^^^
6464 |
6565 = help: consider using an `AtomicI32` instead
6666 = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>`
6767
6868error: using a `Mutex` where an atomic would do
69- --> tests/ui/mutex_atomic.rs:30:5
69+ --> tests/ui/mutex_atomic.rs:31:13
7070 |
71- LL | Mutex::new(0u8);
72- | ^^^^^^^^^^^^^^^
71+ LL | let _ = Mutex::new(0u8);
72+ | ^^^^^^^^^^^^^^^
7373 |
7474 = help: consider using an `AtomicU8` instead
7575 = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>`
7676
7777error: using a `Mutex` where an atomic would do
78- --> tests/ui/mutex_atomic.rs:33:5
78+ --> tests/ui/mutex_atomic.rs:34:13
7979 |
80- LL | Mutex::new(0i16);
81- | ^^^^^^^^^^^^^^^^
80+ LL | let _ = Mutex::new(0i16);
81+ | ^^^^^^^^^^^^^^^^
8282 |
8383 = help: consider using an `AtomicI16` instead
8484 = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>`
8585
8686error: using a `Mutex` where an atomic would do
87- --> tests/ui/mutex_atomic.rs:36 :25
87+ --> tests/ui/mutex_atomic.rs:37 :25
8888 |
8989LL | let _x: Mutex<i8> = Mutex::new(0);
9090 | ^^^^^^^^^^^^^
@@ -93,13 +93,40 @@ LL | let _x: Mutex<i8> = Mutex::new(0);
9393 = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>`
9494
9595error: using a `Mutex` where an atomic would do
96- --> tests/ui/mutex_atomic.rs:40:5
96+ --> tests/ui/mutex_atomic.rs:41:13
9797 |
98- LL | Mutex::new(X);
99- | ^^^^^^^^^^^^^
98+ LL | let _ = Mutex::new(X);
99+ | ^^^^^^^^^^^^^
100100 |
101101 = help: consider using an `AtomicI64` instead
102102 = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>`
103103
104- error: aborting due to 11 previous errors
104+ error: using a `Mutex` where an atomic would do
105+ --> tests/ui/mutex_atomic.rs:51:26
106+ |
107+ LL | static MTX: Mutex<u32> = Mutex::new(0);
108+ | ^^^^^^^^^^^^^
109+ |
110+ = help: consider using an `AtomicU32` instead
111+ = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>`
112+
113+ error: using a `Mutex` where an atomic would do
114+ --> tests/ui/mutex_atomic.rs:59:15
115+ |
116+ LL | let mtx = Mutex::new(0);
117+ | ^^^^^^^^^^^^^
118+ |
119+ = help: consider using an `AtomicI32` instead
120+ = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>`
121+
122+ error: using a `Mutex` where an atomic would do
123+ --> tests/ui/mutex_atomic.rs:63:22
124+ |
125+ LL | let reassigned = mtx;
126+ | ^^^
127+ |
128+ = help: consider using an `AtomicI32` instead
129+ = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>`
130+
131+ error: aborting due to 14 previous errors
105132
0 commit comments