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