Make ExprKind::Closure a struct variant.

This commit is contained in:
Camille GILLOT
2022-06-11 21:25:25 +02:00
parent fa68e73e99
commit 3039cfeb6a
75 changed files with 251 additions and 216 deletions

View File

@@ -405,7 +405,7 @@ impl<'tcx> Visitor<'tcx> for IrMaps<'tcx> {
}
intravisit::walk_expr(self, expr);
}
hir::ExprKind::Closure(..) => {
hir::ExprKind::Closure { .. } => {
// Interesting control flow (for loops can contain labeled
// breaks or continues)
self.add_live_node_for_node(expr.hir_id, ExprNode(expr.span, expr.hir_id));
@@ -833,7 +833,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
hir::ExprKind::Field(ref e, _) => self.propagate_through_expr(&e, succ),
hir::ExprKind::Closure(..) => {
hir::ExprKind::Closure { .. } => {
debug!("{:?} is an ExprKind::Closure", expr);
// the construction of a closure itself is not important,
@@ -1387,7 +1387,7 @@ fn check_expr<'tcx>(this: &mut Liveness<'_, 'tcx>, expr: &'tcx Expr<'tcx>) {
| hir::ExprKind::AddrOf(..)
| hir::ExprKind::Struct(..)
| hir::ExprKind::Repeat(..)
| hir::ExprKind::Closure(..)
| hir::ExprKind::Closure { .. }
| hir::ExprKind::Path(_)
| hir::ExprKind::Yield(..)
| hir::ExprKind::Box(..)