about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2024-06-04 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2024-06-04 22:50:35 +0200
commit5d26f58423f72e300ef48df591c08e3d446b51aa (patch)
tree56a1bf3faac058d9f319ca5da8c02f0d9b176581 /compiler
parent44701e070c8453df10df1984944258018ac21610 (diff)
downloadrust-5d26f58423f72e300ef48df591c08e3d446b51aa.tar.gz
rust-5d26f58423f72e300ef48df591c08e3d446b51aa.zip
Closures are recursively reachable
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_passes/src/reachable.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_passes/src/reachable.rs b/compiler/rustc_passes/src/reachable.rs
index ab1dd248556..954a1ab6560 100644
--- a/compiler/rustc_passes/src/reachable.rs
+++ b/compiler/rustc_passes/src/reachable.rs
@@ -157,6 +157,7 @@ impl<'tcx> ReachableContext<'tcx> {
                 }
                 hir::ImplItemKind::Type(_) => false,
             },
+            Node::Expr(&hir::Expr { kind: hir::ExprKind::Closure(..), .. }) => true,
             _ => false,
         }
     }