Recommend using Mutex<()> for locking

This commit is contained in:
Florian Hartwig 2015-10-11 16:07:00 +02:00
parent 26b2733b15
commit b48db27152

View File

@ -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),