From b48db27152caf31c892312bc8a8ea8db7418e157 Mon Sep 17 00:00:00 2001 From: Florian Hartwig Date: Sun, 11 Oct 2015 16:07:00 +0200 Subject: [PATCH] Recommend using Mutex<()> for locking --- src/mutex_atomic.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mutex_atomic.rs b/src/mutex_atomic.rs index 994e7937984..9c10a062419 100644 --- a/src/mutex_atomic.rs +++ b/src/mutex_atomic.rs @@ -39,7 +39,10 @@ impl LateLintPass for MutexAtomic { let mutex_param = &subst.types.get(ParamSpace::TypeSpace, 0).sty; if let Some(atomic_name) = get_atomic_name(mutex_param) { let msg = format!("Consider using an {} instead of a \ - Mutex here.", atomic_name); + Mutex here. If you just want the \ + locking behaviour and not the internal \ + type, consider using Mutex<()>.", + atomic_name); match *mutex_param { ty::TyUint(t) if t != ast::TyUs => span_lint(cx, MUTEX_INTEGER, expr.span, &msg),