Skip to content

Commit 04867e0

Browse files
committed
mutex-atomic: make lint adhere to lint message convention
1 parent ac194ca commit 04867e0

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

clippy_lints/src/mutex_atomic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ impl<'tcx> LateLintPass<'tcx> for Mutex {
7272
let mutex_param = subst.type_at(0);
7373
if let Some(atomic_name) = get_atomic_name(mutex_param) {
7474
let msg = format!(
75-
"Consider using an `{}` instead of a `Mutex` here. If you just want the locking \
76-
behavior and not the internal type, consider using `Mutex<()>`.",
75+
"consider using an `{}` instead of a `Mutex` here; if you just want the locking \
76+
behavior and not the internal type, consider using `Mutex<()>`",
7777
atomic_name
7878
);
7979
match mutex_param.kind {

tests/ui/mutex_atomic.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
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: consider using an `AtomicBool` instead of a `Mutex` here; if you just want the locking behavior and not the internal type, consider using `Mutex<()>`
22
--> $DIR/mutex_atomic.rs:6:5
33
|
44
LL | Mutex::new(true);
55
| ^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::mutex-atomic` implied by `-D warnings`
88

9-
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<()>`.
9+
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<()>`
1010
--> $DIR/mutex_atomic.rs:7:5
1111
|
1212
LL | Mutex::new(5usize);
1313
| ^^^^^^^^^^^^^^^^^^
1414

15-
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<()>`.
15+
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<()>`
1616
--> $DIR/mutex_atomic.rs:8:5
1717
|
1818
LL | Mutex::new(9isize);
1919
| ^^^^^^^^^^^^^^^^^^
2020

21-
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<()>`.
21+
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<()>`
2222
--> $DIR/mutex_atomic.rs:10:5
2323
|
2424
LL | Mutex::new(&x as *const u32);
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2626

27-
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<()>`.
27+
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<()>`
2828
--> $DIR/mutex_atomic.rs:11:5
2929
|
3030
LL | Mutex::new(&mut x as *mut u32);
3131
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3232

33-
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<()>`.
33+
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<()>`
3434
--> $DIR/mutex_atomic.rs:12:5
3535
|
3636
LL | Mutex::new(0u32);
3737
| ^^^^^^^^^^^^^^^^
3838
|
3939
= note: `-D clippy::mutex-integer` implied by `-D warnings`
4040

41-
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<()>`.
41+
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<()>`
4242
--> $DIR/mutex_atomic.rs:13:5
4343
|
4444
LL | Mutex::new(0i32);

0 commit comments

Comments
 (0)