]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_lint/unused.rs
Merge branch 'refactor-select' of https://github.com/aravind-pg/rust into update...
[rust.git] / src / librustc_lint / unused.rs
index 56f863ab3aa84e6ae881cab222e422793ea3cdbd..6ab3172c4fefaaa1604dfdf0ec72ae75d5521fe9 100644 (file)
@@ -72,7 +72,7 @@ fn check_stmt(&mut self, cx: &LateContext, s: &hir::Stmt) {
 
         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 {
@@ -437,8 +437,10 @@ fn check_expr(&mut self, cx: &LateContext, e: &hir::Expr) {
         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);
             }