1
Fork 0

Continue work on rustup

This commit is contained in:
mcarton 2017-06-03 18:41:46 +02:00
parent 67cccc5c16
commit edef6c53c0
4 changed files with 17 additions and 17 deletions

View file

@ -49,7 +49,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnnecessaryMutPassed {
}
},
ExprMethodCall(ref name, _, ref arguments) => {
let method_type = borrowed_table.expr_ty(e);
let def_id = borrowed_table.type_dependent_defs[&e.id].def_id();
let method_type = cx.tcx.type_of(def_id);
check_arguments(cx, arguments, method_type, &name.node.as_str())
},
_ => (),
@ -70,7 +71,7 @@ fn check_arguments(cx: &LateContext, arguments: &[Expr], type_definition: &TyS,
span_lint(cx,
UNNECESSARY_MUT_PASSED,
argument.span,
&format!("The function/method \"{}\" doesn't need a mutable reference", name));
&format!("The function/method `{}` doesn't need a mutable reference", name));
}
},
_ => (),