diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2017-08-17 23:00:57 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2017-08-17 23:00:57 -0700 |
| commit | 9b6f9d0bc467ef3fc2f3c4bb2dd53528c454a8fa (patch) | |
| tree | 213d7c0f76d8b93abb7d0edd03e3e71404cec872 /src/librustc/hir/map | |
| parent | 59ccba995de202fb9d9a8d795d2770fb2d199db0 (diff) | |
| download | rust-9b6f9d0bc467ef3fc2f3c4bb2dd53528c454a8fa.tar.gz rust-9b6f9d0bc467ef3fc2f3c4bb2dd53528c454a8fa.zip | |
rustc: Rename NodeLocal to NodeBinding
Diffstat (limited to 'src/librustc/hir/map')
| -rw-r--r-- | src/librustc/hir/map/collector.rs | 2 | ||||
| -rw-r--r-- | src/librustc/hir/map/mod.rs | 22 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/librustc/hir/map/collector.rs b/src/librustc/hir/map/collector.rs index d3ae3e0e8e8..7b7d9adec05 100644 --- a/src/librustc/hir/map/collector.rs +++ b/src/librustc/hir/map/collector.rs @@ -138,7 +138,7 @@ impl<'hir> Visitor<'hir> for NodeCollector<'hir> { fn visit_pat(&mut self, pat: &'hir Pat) { let node = if let PatKind::Binding(..) = pat.node { - NodeLocal(pat) + NodeBinding(pat) } else { NodePat(pat) }; diff --git a/src/librustc/hir/map/mod.rs b/src/librustc/hir/map/mod.rs index 8cd229a2adf..1cf4e799ca7 100644 --- a/src/librustc/hir/map/mod.rs +++ b/src/librustc/hir/map/mod.rs @@ -53,7 +53,7 @@ pub enum Node<'hir> { NodeStmt(&'hir Stmt), NodeTy(&'hir Ty), NodeTraitRef(&'hir TraitRef), - NodeLocal(&'hir Pat), + NodeBinding(&'hir Pat), NodePat(&'hir Pat), NodeBlock(&'hir Block), @@ -83,7 +83,7 @@ enum MapEntry<'hir> { EntryStmt(NodeId, &'hir Stmt), EntryTy(NodeId, &'hir Ty), EntryTraitRef(NodeId, &'hir TraitRef), - EntryLocal(NodeId, &'hir Pat), + EntryBinding(NodeId, &'hir Pat), EntryPat(NodeId, &'hir Pat), EntryBlock(NodeId, &'hir Block), EntryStructCtor(NodeId, &'hir VariantData), @@ -114,7 +114,7 @@ impl<'hir> MapEntry<'hir> { NodeStmt(n) => EntryStmt(p, n), NodeTy(n) => EntryTy(p, n), NodeTraitRef(n) => EntryTraitRef(p, n), - NodeLocal(n) => EntryLocal(p, n), + NodeBinding(n) => EntryBinding(p, n), NodePat(n) => EntryPat(p, n), NodeBlock(n) => EntryBlock(p, n), NodeStructCtor(n) => EntryStructCtor(p, n), @@ -136,7 +136,7 @@ impl<'hir> MapEntry<'hir> { EntryStmt(id, _) => id, EntryTy(id, _) => id, EntryTraitRef(id, _) => id, - EntryLocal(id, _) => id, + EntryBinding(id, _) => id, EntryPat(id, _) => id, EntryBlock(id, _) => id, EntryStructCtor(id, _) => id, @@ -161,7 +161,7 @@ impl<'hir> MapEntry<'hir> { EntryStmt(_, n) => NodeStmt(n), EntryTy(_, n) => NodeTy(n), EntryTraitRef(_, n) => NodeTraitRef(n), - EntryLocal(_, n) => NodeLocal(n), + EntryBinding(_, n) => NodeBinding(n), EntryPat(_, n) => NodePat(n), EntryBlock(_, n) => NodeBlock(n), EntryStructCtor(_, n) => NodeStructCtor(n), @@ -319,7 +319,7 @@ impl<'hir> Map<'hir> { EntryStmt(p, _) | EntryTy(p, _) | EntryTraitRef(p, _) | - EntryLocal(p, _) | + EntryBinding(p, _) | EntryPat(p, _) | EntryBlock(p, _) | EntryStructCtor(p, _) | @@ -589,7 +589,7 @@ impl<'hir> Map<'hir> { /// immediate parent is an item or a closure. pub fn is_argument(&self, id: NodeId) -> bool { match self.find(id) { - Some(NodeLocal(_)) => (), + Some(NodeBinding(_)) => (), _ => return false, } match self.find(self.get_parent_node(id)) { @@ -856,7 +856,7 @@ impl<'hir> Map<'hir> { NodeField(f) => f.name, NodeLifetime(lt) => lt.name, NodeTyParam(tp) => tp.name, - NodeLocal(&Pat { node: PatKind::Binding(_,_,l,_), .. }) => l.node, + NodeBinding(&Pat { node: PatKind::Binding(_,_,l,_), .. }) => l.node, NodeStructCtor(_) => self.name(self.get_parent(id)), _ => bug!("no name for {}", self.node_to_string(id)) } @@ -915,7 +915,7 @@ impl<'hir> Map<'hir> { Some(EntryStmt(_, stmt)) => stmt.span, Some(EntryTy(_, ty)) => ty.span, Some(EntryTraitRef(_, tr)) => tr.path.span, - Some(EntryLocal(_, pat)) => pat.span, + Some(EntryBinding(_, pat)) => pat.span, Some(EntryPat(_, pat)) => pat.span, Some(EntryBlock(_, block)) => block.span, Some(EntryStructCtor(_, _)) => self.expect_item(self.get_parent(id)).span, @@ -1112,7 +1112,7 @@ impl<'a> print::State<'a> { NodeStmt(a) => self.print_stmt(&a), NodeTy(a) => self.print_type(&a), NodeTraitRef(a) => self.print_trait_ref(&a), - NodeLocal(a) | + NodeBinding(a) | NodePat(a) => self.print_pat(&a), NodeBlock(a) => { use syntax::print::pprust::PrintState; @@ -1223,7 +1223,7 @@ fn node_id_to_string(map: &Map, id: NodeId, include_id: bool) -> String { Some(NodeTraitRef(_)) => { format!("trait_ref {}{}", map.node_to_pretty_string(id), id_str) } - Some(NodeLocal(_)) => { + Some(NodeBinding(_)) => { format!("local {}{}", map.node_to_pretty_string(id), id_str) } Some(NodePat(_)) => { |
