]> git.lizzy.rs Git - rust.git/commitdiff
rustc: Rename NodeLocal to NodeBinding
authorAlex Crichton <alex@alexcrichton.com>
Fri, 18 Aug 2017 06:00:57 +0000 (23:00 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 18 Aug 2017 06:00:57 +0000 (23:00 -0700)
src/librustc/hir/map/collector.rs
src/librustc/hir/map/mod.rs
src/librustc/middle/mem_categorization.rs
src/librustc/ty/mod.rs
src/librustc_borrowck/borrowck/mod.rs
src/librustc_mir/build/mod.rs
src/librustc_save_analysis/lib.rs

index d3ae3e0e8e8ac4a027e11739a9ce51ac4d32268c..7b7d9adec05eded99e1a1887f600b858d917df68 100644 (file)
@@ -138,7 +138,7 @@ fn visit_impl_item(&mut self, ii: &'hir ImplItem) {
 
     fn visit_pat(&mut self, pat: &'hir Pat) {
         let node = if let PatKind::Binding(..) = pat.node {
-            NodeLocal(pat)
+            NodeBinding(pat)
         } else {
             NodePat(pat)
         };
index 8cd229a2adf63007ed2587daf75c00e3327304ec..1cf4e799ca769d94320e7c6cbac2eba51aaea7a6 100644 (file)
@@ -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 @@ fn from_node(p: NodeId, node: Node<'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 @@ fn parent_node(self) -> Option<NodeId> {
             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 @@ fn to_node(self) -> Option<Node<'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 @@ fn dep_node(&self, id0: NodeId) -> DepNode {
                 EntryStmt(p, _) |
                 EntryTy(p, _) |
                 EntryTraitRef(p, _) |
-                EntryLocal(p, _) |
+                EntryBinding(p, _) |
                 EntryPat(p, _) |
                 EntryBlock(p, _) |
                 EntryStructCtor(p, _) |
@@ -589,7 +589,7 @@ pub fn get_parent_node(&self, id: NodeId) -> NodeId {
     /// 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 @@ pub fn name(&self, id: NodeId) -> Name {
             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 @@ pub fn span(&self, id: NodeId) -> Span {
             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 @@ pub fn print_node(&mut self, node: Node) -> io::Result<()> {
             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(_)) => {
index c8a7f8c4aaf8c8d3369744ed65730379ac348a6d..8cd023b8e638b87a502aa4b0e6eb4cd0e9c92f0d 100644 (file)
@@ -332,7 +332,7 @@ fn from_pointer_kind(base_mutbl: MutabilityCategory,
 
     fn from_local(tcx: TyCtxt, tables: &ty::TypeckTables, id: ast::NodeId) -> MutabilityCategory {
         let ret = match tcx.hir.get(id) {
-            hir_map::NodeLocal(p) => match p.node {
+            hir_map::NodeBinding(p) => match p.node {
                 PatKind::Binding(..) => {
                     let bm = *tables.pat_binding_modes()
                                     .get(p.hir_id)
index 1daabd744aee51f8a7b1579787fbac9c1ccf6d53..7e402075fcfea309e5ce8c6f12d722b8afb50714 100644 (file)
@@ -1971,7 +1971,7 @@ pub fn expr_span(self, id: NodeId) -> Span {
 
     pub fn local_var_name_str(self, id: NodeId) -> InternedString {
         match self.hir.find(id) {
-            Some(hir_map::NodeLocal(pat)) => {
+            Some(hir_map::NodeBinding(pat)) => {
                 match pat.node {
                     hir::PatKind::Binding(_, _, ref path1, _) => path1.node.as_str(),
                     _ => {
index 8c79534d209ef8549dffb4c120cc6fc8e6785ad8..0d81395a2a2bd3023527ade96a2ea826f6099f2e 100644 (file)
@@ -916,7 +916,7 @@ fn suggest_mut_for_immutable(&self, pty: &hir::Ty, is_implicit_self: bool) -> Op
 
     fn local_binding_mode(&self, node_id: ast::NodeId) -> ty::BindingMode {
         let pat = match self.tcx.hir.get(node_id) {
-            hir_map::Node::NodeLocal(pat) => pat,
+            hir_map::Node::NodeBinding(pat) => pat,
             node => bug!("bad node for local: {:?}", node)
         };
 
index 0c7a78c980a48b93bbd65816a04615937f6fbdc4..d7a295a1c3a2432df346a2b1d1acd7829fdec24f 100644 (file)
@@ -382,7 +382,7 @@ fn construct_fn<'a, 'gcx, 'tcx, A>(hir: Cx<'a, 'gcx, 'tcx>,
                 debug_name: keywords::Invalid.name(),
                 by_ref,
             };
-            if let Some(hir::map::NodeLocal(pat)) = tcx.hir.find(var_node_id) {
+            if let Some(hir::map::NodeBinding(pat)) = tcx.hir.find(var_node_id) {
                 if let hir::PatKind::Binding(_, _, ref ident, _) = pat.node {
                     decl.debug_name = ident.node;
                 }
index f16ce13b2d5c8b31d6b57653829e1df84ce3ba6b..0c0a9e4ba90a4dfb1d7913b6b81d47d2287fc08a 100644 (file)
@@ -591,7 +591,7 @@ pub fn get_path_def(&self, id: NodeId) -> HirDef {
                 self.tables.qpath_def(qpath, hir_id)
             }
 
-            Node::NodeLocal(&hir::Pat { node: hir::PatKind::Binding(_, def_id, ..), .. }) => {
+            Node::NodeBinding(&hir::Pat { node: hir::PatKind::Binding(_, def_id, ..), .. }) => {
                 HirDef::Local(def_id)
             }