Make ExprKind::Closure a struct variant.
This commit is contained in:
@@ -75,7 +75,7 @@ impl<'tcx> Visitor<'tcx> for CaptureCollector<'_, 'tcx> {
|
||||
}
|
||||
|
||||
fn visit_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) {
|
||||
if let hir::ExprKind::Closure(..) = expr.kind {
|
||||
if let hir::ExprKind::Closure { .. } = expr.kind {
|
||||
let closure_def_id = self.tcx.hir().local_def_id(expr.hir_id);
|
||||
if let Some(upvars) = self.tcx.upvars_mentioned(closure_def_id) {
|
||||
// Every capture of a closure expression is a local in scope,
|
||||
|
||||
Reference in New Issue
Block a user