Use LocalDefId for closures more

This commit is contained in:
Cameron Steffen 2022-07-12 09:10:22 -05:00
parent ab7e555ad9
commit 62907727af
1 changed files with 1 additions and 1 deletions

View File

@ -968,7 +968,7 @@ pub fn can_move_expr_to_closure<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'
} }
}, },
ExprKind::Closure { .. } => { ExprKind::Closure { .. } => {
let closure_id = self.cx.tcx.hir().local_def_id(e.hir_id).to_def_id(); let closure_id = self.cx.tcx.hir().local_def_id(e.hir_id);
for capture in self.cx.typeck_results().closure_min_captures_flattened(closure_id) { for capture in self.cx.typeck_results().closure_min_captures_flattened(closure_id) {
let local_id = match capture.place.base { let local_id = match capture.place.base {
PlaceBase::Local(id) => id, PlaceBase::Local(id) => id,