Skip to content

Commit 9b6f9d0

Browse files
committed
rustc: Rename NodeLocal to NodeBinding
1 parent 59ccba9 commit 9b6f9d0

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

src/librustc/hir/map/collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl<'hir> Visitor<'hir> for NodeCollector<'hir> {
138138

139139
fn visit_pat(&mut self, pat: &'hir Pat) {
140140
let node = if let PatKind::Binding(..) = pat.node {
141-
NodeLocal(pat)
141+
NodeBinding(pat)
142142
} else {
143143
NodePat(pat)
144144
};

src/librustc/hir/map/mod.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub enum Node<'hir> {
5353
NodeStmt(&'hir Stmt),
5454
NodeTy(&'hir Ty),
5555
NodeTraitRef(&'hir TraitRef),
56-
NodeLocal(&'hir Pat),
56+
NodeBinding(&'hir Pat),
5757
NodePat(&'hir Pat),
5858
NodeBlock(&'hir Block),
5959

@@ -83,7 +83,7 @@ enum MapEntry<'hir> {
8383
EntryStmt(NodeId, &'hir Stmt),
8484
EntryTy(NodeId, &'hir Ty),
8585
EntryTraitRef(NodeId, &'hir TraitRef),
86-
EntryLocal(NodeId, &'hir Pat),
86+
EntryBinding(NodeId, &'hir Pat),
8787
EntryPat(NodeId, &'hir Pat),
8888
EntryBlock(NodeId, &'hir Block),
8989
EntryStructCtor(NodeId, &'hir VariantData),
@@ -114,7 +114,7 @@ impl<'hir> MapEntry<'hir> {
114114
NodeStmt(n) => EntryStmt(p, n),
115115
NodeTy(n) => EntryTy(p, n),
116116
NodeTraitRef(n) => EntryTraitRef(p, n),
117-
NodeLocal(n) => EntryLocal(p, n),
117+
NodeBinding(n) => EntryBinding(p, n),
118118
NodePat(n) => EntryPat(p, n),
119119
NodeBlock(n) => EntryBlock(p, n),
120120
NodeStructCtor(n) => EntryStructCtor(p, n),
@@ -136,7 +136,7 @@ impl<'hir> MapEntry<'hir> {
136136
EntryStmt(id, _) => id,
137137
EntryTy(id, _) => id,
138138
EntryTraitRef(id, _) => id,
139-
EntryLocal(id, _) => id,
139+
EntryBinding(id, _) => id,
140140
EntryPat(id, _) => id,
141141
EntryBlock(id, _) => id,
142142
EntryStructCtor(id, _) => id,
@@ -161,7 +161,7 @@ impl<'hir> MapEntry<'hir> {
161161
EntryStmt(_, n) => NodeStmt(n),
162162
EntryTy(_, n) => NodeTy(n),
163163
EntryTraitRef(_, n) => NodeTraitRef(n),
164-
EntryLocal(_, n) => NodeLocal(n),
164+
EntryBinding(_, n) => NodeBinding(n),
165165
EntryPat(_, n) => NodePat(n),
166166
EntryBlock(_, n) => NodeBlock(n),
167167
EntryStructCtor(_, n) => NodeStructCtor(n),
@@ -319,7 +319,7 @@ impl<'hir> Map<'hir> {
319319
EntryStmt(p, _) |
320320
EntryTy(p, _) |
321321
EntryTraitRef(p, _) |
322-
EntryLocal(p, _) |
322+
EntryBinding(p, _) |
323323
EntryPat(p, _) |
324324
EntryBlock(p, _) |
325325
EntryStructCtor(p, _) |
@@ -589,7 +589,7 @@ impl<'hir> Map<'hir> {
589589
/// immediate parent is an item or a closure.
590590
pub fn is_argument(&self, id: NodeId) -> bool {
591591
match self.find(id) {
592-
Some(NodeLocal(_)) => (),
592+
Some(NodeBinding(_)) => (),
593593
_ => return false,
594594
}
595595
match self.find(self.get_parent_node(id)) {
@@ -856,7 +856,7 @@ impl<'hir> Map<'hir> {
856856
NodeField(f) => f.name,
857857
NodeLifetime(lt) => lt.name,
858858
NodeTyParam(tp) => tp.name,
859-
NodeLocal(&Pat { node: PatKind::Binding(_,_,l,_), .. }) => l.node,
859+
NodeBinding(&Pat { node: PatKind::Binding(_,_,l,_), .. }) => l.node,
860860
NodeStructCtor(_) => self.name(self.get_parent(id)),
861861
_ => bug!("no name for {}", self.node_to_string(id))
862862
}
@@ -915,7 +915,7 @@ impl<'hir> Map<'hir> {
915915
Some(EntryStmt(_, stmt)) => stmt.span,
916916
Some(EntryTy(_, ty)) => ty.span,
917917
Some(EntryTraitRef(_, tr)) => tr.path.span,
918-
Some(EntryLocal(_, pat)) => pat.span,
918+
Some(EntryBinding(_, pat)) => pat.span,
919919
Some(EntryPat(_, pat)) => pat.span,
920920
Some(EntryBlock(_, block)) => block.span,
921921
Some(EntryStructCtor(_, _)) => self.expect_item(self.get_parent(id)).span,
@@ -1112,7 +1112,7 @@ impl<'a> print::State<'a> {
11121112
NodeStmt(a) => self.print_stmt(&a),
11131113
NodeTy(a) => self.print_type(&a),
11141114
NodeTraitRef(a) => self.print_trait_ref(&a),
1115-
NodeLocal(a) |
1115+
NodeBinding(a) |
11161116
NodePat(a) => self.print_pat(&a),
11171117
NodeBlock(a) => {
11181118
use syntax::print::pprust::PrintState;
@@ -1223,7 +1223,7 @@ fn node_id_to_string(map: &Map, id: NodeId, include_id: bool) -> String {
12231223
Some(NodeTraitRef(_)) => {
12241224
format!("trait_ref {}{}", map.node_to_pretty_string(id), id_str)
12251225
}
1226-
Some(NodeLocal(_)) => {
1226+
Some(NodeBinding(_)) => {
12271227
format!("local {}{}", map.node_to_pretty_string(id), id_str)
12281228
}
12291229
Some(NodePat(_)) => {

src/librustc/middle/mem_categorization.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ impl MutabilityCategory {
332332

333333
fn from_local(tcx: TyCtxt, tables: &ty::TypeckTables, id: ast::NodeId) -> MutabilityCategory {
334334
let ret = match tcx.hir.get(id) {
335-
hir_map::NodeLocal(p) => match p.node {
335+
hir_map::NodeBinding(p) => match p.node {
336336
PatKind::Binding(..) => {
337337
let bm = *tables.pat_binding_modes()
338338
.get(p.hir_id)

src/librustc/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1971,7 +1971,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
19711971

19721972
pub fn local_var_name_str(self, id: NodeId) -> InternedString {
19731973
match self.hir.find(id) {
1974-
Some(hir_map::NodeLocal(pat)) => {
1974+
Some(hir_map::NodeBinding(pat)) => {
19751975
match pat.node {
19761976
hir::PatKind::Binding(_, _, ref path1, _) => path1.node.as_str(),
19771977
_ => {

src/librustc_borrowck/borrowck/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
916916

917917
fn local_binding_mode(&self, node_id: ast::NodeId) -> ty::BindingMode {
918918
let pat = match self.tcx.hir.get(node_id) {
919-
hir_map::Node::NodeLocal(pat) => pat,
919+
hir_map::Node::NodeBinding(pat) => pat,
920920
node => bug!("bad node for local: {:?}", node)
921921
};
922922

src/librustc_mir/build/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ fn construct_fn<'a, 'gcx, 'tcx, A>(hir: Cx<'a, 'gcx, 'tcx>,
382382
debug_name: keywords::Invalid.name(),
383383
by_ref,
384384
};
385-
if let Some(hir::map::NodeLocal(pat)) = tcx.hir.find(var_node_id) {
385+
if let Some(hir::map::NodeBinding(pat)) = tcx.hir.find(var_node_id) {
386386
if let hir::PatKind::Binding(_, _, ref ident, _) = pat.node {
387387
decl.debug_name = ident.node;
388388
}

src/librustc_save_analysis/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
591591
self.tables.qpath_def(qpath, hir_id)
592592
}
593593

594-
Node::NodeLocal(&hir::Pat { node: hir::PatKind::Binding(_, def_id, ..), .. }) => {
594+
Node::NodeBinding(&hir::Pat { node: hir::PatKind::Binding(_, def_id, ..), .. }) => {
595595
HirDef::Local(def_id)
596596
}
597597

0 commit comments

Comments
 (0)