diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs index e29e4786671..73753382a7c 100644 --- a/src/librustc/traits/error_reporting.rs +++ b/src/librustc/traits/error_reporting.rs @@ -657,13 +657,18 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { }; if let Some(tables) = infer_tables { - if let Some(&(ty::ClosureKind::FnOnce, Some((span, name)))) = - tables.closure_kinds.get(&node_id) - { - err.span_note( - span, - &format!("closure is `FnOnce` because it moves the \ - variable `{}` out of its environment", name)); + match tables.closure_kinds.get(&node_id) { + Some(&(ty::ClosureKind::FnOnce, Some((span, name)))) => { + err.span_note(span, &format!( + "closure is `FnOnce` because it moves the \ + variable `{}` out of its environment", name)); + }, + Some(&(ty::ClosureKind::FnMut, Some((span, name)))) => { + err.span_note(span, &format!( + "closure is `FnMut` because it mutates the \ + variable `{}` here", name)); + }, + _ => {} } } else { err.span_note(