diff options
| author | Cameron Steffen <cam.steffen94@gmail.com> | 2022-06-28 13:15:30 -0500 |
|---|---|---|
| committer | Cameron Steffen <cam.steffen94@gmail.com> | 2022-07-01 10:04:19 -0500 |
| commit | ec82bc199611e7f1cf3acd612a65eed81d22636b (patch) | |
| tree | 370d40d9dfc6d84175cb8c0679fe7cd712e186f2 /compiler/rustc_ast_lowering/src | |
| parent | ca1e68b3229e710c3948a361ee770d846a88e6da (diff) | |
| download | rust-ec82bc199611e7f1cf3acd612a65eed81d22636b.tar.gz rust-ec82bc199611e7f1cf3acd612a65eed81d22636b.zip | |
Factor out hir::Node::Binding
Diffstat (limited to 'compiler/rustc_ast_lowering/src')
| -rw-r--r-- | compiler/rustc_ast_lowering/src/index.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_ast_lowering/src/index.rs b/compiler/rustc_ast_lowering/src/index.rs index 4be22020ba1..ddd54f7c208 100644 --- a/compiler/rustc_ast_lowering/src/index.rs +++ b/compiler/rustc_ast_lowering/src/index.rs @@ -192,9 +192,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> { } fn visit_pat(&mut self, pat: &'hir Pat<'hir>) { - let node = - if let PatKind::Binding(..) = pat.kind { Node::Binding(pat) } else { Node::Pat(pat) }; - self.insert(pat.span, pat.hir_id, node); + self.insert(pat.span, pat.hir_id, Node::Pat(pat)); self.with_parent(pat.hir_id, |this| { intravisit::walk_pat(this, pat); |
