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