Skip to content

Commit b48db27

Browse files
committed
Recommend using Mutex<()> for locking
1 parent 26b2733 commit b48db27

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/mutex_atomic.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ impl LateLintPass for MutexAtomic {
3939
let mutex_param = &subst.types.get(ParamSpace::TypeSpace, 0).sty;
4040
if let Some(atomic_name) = get_atomic_name(mutex_param) {
4141
let msg = format!("Consider using an {} instead of a \
42-
Mutex here.", atomic_name);
42+
Mutex here. If you just want the \
43+
locking behaviour and not the internal \
44+
type, consider using Mutex<()>.",
45+
atomic_name);
4346
match *mutex_param {
4447
ty::TyUint(t) if t != ast::TyUs =>
4548
span_lint(cx, MUTEX_INTEGER, expr.span, &msg),

0 commit comments

Comments
 (0)