about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2025-03-26 14:48:14 +0100
committerMara Bos <m-ou.se@m-ou.se>2025-03-26 17:18:18 +0100
commit1da5e60ac59661bca0d09b50839600fe0deeb0aa (patch)
treecf5b7ceadf4536712efce0c415be90937cd1d2ad
parent6e8abb5ec65ac50f934df6cf0e8f248dc8e8805e (diff)
downloadrust-1da5e60ac59661bca0d09b50839600fe0deeb0aa.tar.gz
rust-1da5e60ac59661bca0d09b50839600fe0deeb0aa.zip
Don't record child scopes for patterns.
They are unused.
-rw-r--r--compiler/rustc_hir_analysis/src/check/region.rs2
1 files changed, 0 insertions, 2 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/region.rs b/compiler/rustc_hir_analysis/src/check/region.rs
index 255f5fee52a..c81f75eb319 100644
--- a/compiler/rustc_hir_analysis/src/check/region.rs
+++ b/compiler/rustc_hir_analysis/src/check/region.rs
@@ -221,8 +221,6 @@ fn resolve_arm<'tcx>(visitor: &mut ScopeResolutionVisitor<'tcx>, arm: &'tcx hir:
 }
 
 fn resolve_pat<'tcx>(visitor: &mut ScopeResolutionVisitor<'tcx>, pat: &'tcx hir::Pat<'tcx>) {
-    visitor.record_child_scope(Scope { local_id: pat.hir_id.local_id, data: ScopeData::Node });
-
     // If this is a binding then record the lifetime of that binding.
     if let PatKind::Binding(..) = pat.kind {
         record_var_lifetime(visitor, pat.hir_id.local_id);