We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f00ffc commit 4fbd5ccCopy full SHA for 4fbd5cc
clippy_lints/src/redundant_locals.rs
@@ -101,7 +101,7 @@ impl<'tcx> LateLintPass<'tcx> for RedundantLocals {
101
fn is_by_value_closure_capture(cx: &LateContext<'_>, redefinition: HirId, root_variable: HirId) -> bool {
102
let closure_def_id = cx.tcx.hir().enclosing_body_owner(redefinition);
103
104
- cx.tcx.is_closure_or_coroutine(closure_def_id.to_def_id())
+ cx.tcx.is_closure_like(closure_def_id.to_def_id())
105
&& cx.tcx.closure_captures(closure_def_id).iter().any(|c| {
106
matches!(c.info.capture_kind, UpvarCapture::ByValue)
107
&& matches!(c.place.base, PlaceBase::Upvar(upvar) if upvar.var_path.hir_id == root_variable)
0 commit comments