|
1 | | -error: consider using an `AtomicBool` instead of a `Mutex` here; if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| 1 | +error: using a `Mutex` where an atomic would do |
2 | 2 | --> tests/ui/mutex_atomic.rs:7:5 |
3 | 3 | | |
4 | 4 | LL | Mutex::new(true); |
5 | 5 | | ^^^^^^^^^^^^^^^^ |
6 | 6 | | |
| 7 | + = help: consider using an `AtomicBool` instead |
| 8 | + = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
7 | 9 | = note: `-D clippy::mutex-atomic` implied by `-D warnings` |
8 | 10 | = help: to override `-D warnings` add `#[allow(clippy::mutex_atomic)]` |
9 | 11 |
|
10 | | -error: consider using an `AtomicUsize` instead of a `Mutex` here; if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| 12 | +error: using a `Mutex` where an atomic would do |
11 | 13 | --> tests/ui/mutex_atomic.rs:10:5 |
12 | 14 | | |
13 | 15 | LL | Mutex::new(5usize); |
14 | 16 | | ^^^^^^^^^^^^^^^^^^ |
| 17 | + | |
| 18 | + = help: consider using an `AtomicUsize` instead |
| 19 | + = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
15 | 20 |
|
16 | | -error: consider using an `AtomicIsize` instead of a `Mutex` here; if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| 21 | +error: using a `Mutex` where an atomic would do |
17 | 22 | --> tests/ui/mutex_atomic.rs:13:5 |
18 | 23 | | |
19 | 24 | LL | Mutex::new(9isize); |
20 | 25 | | ^^^^^^^^^^^^^^^^^^ |
| 26 | + | |
| 27 | + = help: consider using an `AtomicIsize` instead |
| 28 | + = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
21 | 29 |
|
22 | | -error: consider using an `AtomicPtr` instead of a `Mutex` here; if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| 30 | +error: using a `Mutex` where an atomic would do |
23 | 31 | --> tests/ui/mutex_atomic.rs:17:5 |
24 | 32 | | |
25 | 33 | LL | Mutex::new(&x as *const u32); |
26 | 34 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 35 | + | |
| 36 | + = help: consider using an `AtomicPtr` instead |
| 37 | + = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
27 | 38 |
|
28 | | -error: consider using an `AtomicPtr` instead of a `Mutex` here; if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| 39 | +error: using a `Mutex` where an atomic would do |
29 | 40 | --> tests/ui/mutex_atomic.rs:20:5 |
30 | 41 | | |
31 | 42 | LL | Mutex::new(&mut x as *mut u32); |
32 | 43 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 44 | + | |
| 45 | + = help: consider using an `AtomicPtr` instead |
| 46 | + = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
33 | 47 |
|
34 | | -error: consider using an `AtomicU32` instead of a `Mutex` here; if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| 48 | +error: using a `Mutex` where an atomic would do |
35 | 49 | --> tests/ui/mutex_atomic.rs:23:5 |
36 | 50 | | |
37 | 51 | LL | Mutex::new(0u32); |
38 | 52 | | ^^^^^^^^^^^^^^^^ |
39 | 53 | | |
| 54 | + = help: consider using an `AtomicU32` instead |
| 55 | + = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
40 | 56 | = note: `-D clippy::mutex-integer` implied by `-D warnings` |
41 | 57 | = help: to override `-D warnings` add `#[allow(clippy::mutex_integer)]` |
42 | 58 |
|
43 | | -error: consider using an `AtomicI32` instead of a `Mutex` here; if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| 59 | +error: using a `Mutex` where an atomic would do |
44 | 60 | --> tests/ui/mutex_atomic.rs:26:5 |
45 | 61 | | |
46 | 62 | LL | Mutex::new(0i32); |
47 | 63 | | ^^^^^^^^^^^^^^^^ |
| 64 | + | |
| 65 | + = help: consider using an `AtomicI32` instead |
| 66 | + = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
48 | 67 |
|
49 | | -error: consider using an `AtomicU8` instead of a `Mutex` here; if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| 68 | +error: using a `Mutex` where an atomic would do |
50 | 69 | --> tests/ui/mutex_atomic.rs:30:5 |
51 | 70 | | |
52 | 71 | LL | Mutex::new(0u8); |
53 | 72 | | ^^^^^^^^^^^^^^^ |
| 73 | + | |
| 74 | + = help: consider using an `AtomicU8` instead |
| 75 | + = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
54 | 76 |
|
55 | | -error: consider using an `AtomicI16` instead of a `Mutex` here; if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| 77 | +error: using a `Mutex` where an atomic would do |
56 | 78 | --> tests/ui/mutex_atomic.rs:33:5 |
57 | 79 | | |
58 | 80 | LL | Mutex::new(0i16); |
59 | 81 | | ^^^^^^^^^^^^^^^^ |
| 82 | + | |
| 83 | + = help: consider using an `AtomicI16` instead |
| 84 | + = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
60 | 85 |
|
61 | | -error: consider using an `AtomicI8` instead of a `Mutex` here; if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| 86 | +error: using a `Mutex` where an atomic would do |
62 | 87 | --> tests/ui/mutex_atomic.rs:36:25 |
63 | 88 | | |
64 | 89 | LL | let _x: Mutex<i8> = Mutex::new(0); |
65 | 90 | | ^^^^^^^^^^^^^ |
| 91 | + | |
| 92 | + = help: consider using an `AtomicI8` instead |
| 93 | + = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
66 | 94 |
|
67 | | -error: consider using an `AtomicI64` instead of a `Mutex` here; if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
| 95 | +error: using a `Mutex` where an atomic would do |
68 | 96 | --> tests/ui/mutex_atomic.rs:40:5 |
69 | 97 | | |
70 | 98 | LL | Mutex::new(X); |
71 | 99 | | ^^^^^^^^^^^^^ |
| 100 | + | |
| 101 | + = help: consider using an `AtomicI64` instead |
| 102 | + = help: if you just want the locking behavior and not the internal type, consider using `Mutex<()>` |
72 | 103 |
|
73 | 104 | error: aborting due to 11 previous errors |
74 | 105 |
|
0 commit comments