Skip to content

Commit 4fbd5cc

Browse files
is_closure_like
1 parent 8f00ffc commit 4fbd5cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/redundant_locals.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<'tcx> LateLintPass<'tcx> for RedundantLocals {
101101
fn is_by_value_closure_capture(cx: &LateContext<'_>, redefinition: HirId, root_variable: HirId) -> bool {
102102
let closure_def_id = cx.tcx.hir().enclosing_body_owner(redefinition);
103103

104-
cx.tcx.is_closure_or_coroutine(closure_def_id.to_def_id())
104+
cx.tcx.is_closure_like(closure_def_id.to_def_id())
105105
&& cx.tcx.closure_captures(closure_def_id).iter().any(|c| {
106106
matches!(c.info.capture_kind, UpvarCapture::ByValue)
107107
&& matches!(c.place.base, PlaceBase::Upvar(upvar) if upvar.var_path.hir_id == root_variable)

0 commit comments

Comments
 (0)