let mut fn_warned = false;
let mut op_warned = false;
- if cx.tcx.sess.features.borrow().fn_must_use {
+ if cx.tcx.features().fn_must_use {
let maybe_def = match expr.node {
hir::ExprCall(ref callee, _) => {
match callee.node {
for adj in cx.tables.expr_adjustments(e) {
if let adjustment::Adjust::Borrow(adjustment::AutoBorrow::Ref(_, m)) = adj.kind {
let msg = match m {
- hir::MutImmutable => "unnecessary allocation, use & instead",
- hir::MutMutable => "unnecessary allocation, use &mut instead"
+ adjustment::AutoBorrowMutability::Immutable =>
+ "unnecessary allocation, use & instead",
+ adjustment::AutoBorrowMutability::Mutable { .. }=>
+ "unnecessary allocation, use &mut instead"
};
cx.span_lint(UNUSED_ALLOCATION, e.span, msg);
}