about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2021-09-18 17:37:24 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2021-09-20 08:45:39 -0400
commitede86797bd8249db720fc61a0c6b9d94c0bd9052 (patch)
tree089aad873b21c23ca673c7fbdb03154db8883335
parentd37f1091e84cd769eb17af62ee13160087fbf176 (diff)
downloadrust-ede86797bd8249db720fc61a0c6b9d94c0bd9052.tar.gz
rust-ede86797bd8249db720fc61a0c6b9d94c0bd9052.zip
Enable 2021 compatibility lints for all in-tree code
This just applies the suggested fixes from the compatibility warnings,
leaving any that are in practice spurious in. This is primarily intended to
provide a starting point to identify possible fixes to the migrations (e.g., by
avoiding spurious warnings).

A secondary commit cleans these up where they are false positives (as is true in
many of the cases).
-rw-r--r--clippy_utils/src/lib.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs
index 3a94f472983..5c505f6851a 100644
--- a/clippy_utils/src/lib.rs
+++ b/clippy_utils/src/lib.rs
@@ -990,7 +990,10 @@ pub fn can_move_expr_to_closure(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) ->
         captures: HirIdMap::default(),
     };
     v.visit_expr(expr);
-    v.allow_closure.then(|| v.captures)
+    v.allow_closure.then(|| {
+        let _ = &v;
+        v.captures
+    })
 }
 
 /// Returns the method names and argument list of nested method call expressions that make up