Skip to content

Commit ce6aabb

Browse files
committed
Rename ImplItem.node to ImplItem.kind
1 parent 8bd0382 commit ce6aabb

File tree

48 files changed

+107
-108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+107
-108
lines changed

src/librustc/hir/intravisit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ pub fn walk_impl_item<'v, V: Visitor<'v>>(visitor: &mut V, impl_item: &'v ImplIt
905905
ref defaultness,
906906
ref attrs,
907907
ref generics,
908-
ref node,
908+
ref kind,
909909
span: _,
910910
} = *impl_item;
911911

@@ -914,7 +914,7 @@ pub fn walk_impl_item<'v, V: Visitor<'v>>(visitor: &mut V, impl_item: &'v ImplIt
914914
visitor.visit_defaultness(defaultness);
915915
walk_list!(visitor, visit_attribute, attrs);
916916
visitor.visit_generics(generics);
917-
match *node {
917+
match *kind {
918918
ImplItemKind::Const(ref ty, body) => {
919919
visitor.visit_id(impl_item.hir_id);
920920
visitor.visit_ty(ty);

src/librustc/hir/lowering/item.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ impl LoweringContext<'_> {
902902
fn lower_impl_item(&mut self, i: &ImplItem) -> hir::ImplItem {
903903
let impl_item_def_id = self.resolver.definitions().local_def_id(i.id);
904904

905-
let (generics, node) = match i.node {
905+
let (generics, kind) = match i.kind {
906906
ImplItemKind::Const(ref ty, ref expr) => (
907907
self.lower_generics(&i.generics, ImplTraitContext::disallowed()),
908908
hir::ImplItemKind::Const(
@@ -946,7 +946,7 @@ impl LoweringContext<'_> {
946946
generics,
947947
vis: self.lower_visibility(&i.vis, None),
948948
defaultness: self.lower_defaultness(i.defaultness, true /* [1] */),
949-
node,
949+
kind,
950950
span: i.span,
951951
}
952952

@@ -960,7 +960,7 @@ impl LoweringContext<'_> {
960960
span: i.span,
961961
vis: self.lower_visibility(&i.vis, Some(i.id)),
962962
defaultness: self.lower_defaultness(i.defaultness, true /* [1] */),
963-
kind: match i.node {
963+
kind: match i.kind {
964964
ImplItemKind::Const(..) => hir::AssocItemKind::Const,
965965
ImplItemKind::TyAlias(..) => hir::AssocItemKind::Type,
966966
ImplItemKind::OpaqueTy(..) => hir::AssocItemKind::OpaqueTy,

src/librustc/hir/map/blocks.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ impl MaybeFnLike for ast::Item {
4343

4444
impl MaybeFnLike for ast::ImplItem {
4545
fn is_fn_like(&self) -> bool {
46-
match self.node { ast::ImplItemKind::Method(..) => true, _ => false, }
46+
match self.kind {
47+
ast::ImplItemKind::Method(..) => true,
48+
_ => false,
49+
}
4750
}
4851
}
4952

@@ -234,7 +237,7 @@ impl<'a> FnLikeNode<'a> {
234237
_ => bug!("trait method FnLikeNode that is not fn-like"),
235238
},
236239
map::Node::ImplItem(ii) => {
237-
match ii.node {
240+
match ii.kind {
238241
ast::ImplItemKind::Method(ref sig, body) => {
239242
method(ii.hir_id, ii.ident, sig, Some(&ii.vis), body, ii.span, &ii.attrs)
240243
}

src/librustc/hir/map/def_collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
228228
}
229229

230230
fn visit_impl_item(&mut self, ii: &'a ImplItem) {
231-
let def_data = match ii.node {
231+
let def_data = match ii.kind {
232232
ImplItemKind::Method(MethodSig {
233233
ref header,
234234
ref decl,

src/librustc/hir/map/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'hir> Entry<'hir> {
6464
}
6565

6666
Node::ImplItem(ref item) => {
67-
match item.node {
67+
match item.kind {
6868
ImplItemKind::Method(ref method_sig, _) => Some(&method_sig.decl),
6969
_ => None,
7070
}
@@ -101,7 +101,7 @@ impl<'hir> Entry<'hir> {
101101
}
102102

103103
Node::ImplItem(item) => {
104-
match item.node {
104+
match item.kind {
105105
ImplItemKind::Const(_, body) |
106106
ImplItemKind::Method(_, body) => Some(body),
107107
_ => None,
@@ -327,7 +327,7 @@ impl<'hir> Map<'hir> {
327327
}
328328
}
329329
Node::ImplItem(item) => {
330-
match item.node {
330+
match item.kind {
331331
ImplItemKind::Const(..) => DefKind::AssocConst,
332332
ImplItemKind::Method(..) => DefKind::Method,
333333
ImplItemKind::TyAlias(..) => DefKind::AssocTy,
@@ -455,14 +455,14 @@ impl<'hir> Map<'hir> {
455455
match self.get(id) {
456456
Node::Item(&Item { node: ItemKind::Const(..), .. }) |
457457
Node::TraitItem(&TraitItem { node: TraitItemKind::Const(..), .. }) |
458-
Node::ImplItem(&ImplItem { node: ImplItemKind::Const(..), .. }) |
458+
Node::ImplItem(&ImplItem { kind: ImplItemKind::Const(..), .. }) |
459459
Node::AnonConst(_) => {
460460
BodyOwnerKind::Const
461461
}
462462
Node::Ctor(..) |
463463
Node::Item(&Item { node: ItemKind::Fn(..), .. }) |
464464
Node::TraitItem(&TraitItem { node: TraitItemKind::Method(..), .. }) |
465-
Node::ImplItem(&ImplItem { node: ImplItemKind::Method(..), .. }) => {
465+
Node::ImplItem(&ImplItem { kind: ImplItemKind::Method(..), .. }) => {
466466
BodyOwnerKind::Fn
467467
}
468468
Node::Item(&Item { node: ItemKind::Static(_, m, _), .. }) => {
@@ -657,7 +657,7 @@ impl<'hir> Map<'hir> {
657657
..
658658
})
659659
| Node::ImplItem(&ImplItem {
660-
node: ImplItemKind::Const(..),
660+
kind: ImplItemKind::Const(..),
661661
..
662662
})
663663
| Node::AnonConst(_)
@@ -832,7 +832,7 @@ impl<'hir> Map<'hir> {
832832
}
833833
},
834834
Node::ImplItem(ii) => {
835-
match ii.node {
835+
match ii.kind {
836836
ImplItemKind::Method(..) => true,
837837
_ => false,
838838
}
@@ -1310,7 +1310,7 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
13101310
format!("foreign item {}{}", path_str(), id_str)
13111311
}
13121312
Some(Node::ImplItem(ii)) => {
1313-
match ii.node {
1313+
match ii.kind {
13141314
ImplItemKind::Const(..) => {
13151315
format!("assoc const {} in {}{}", ii.ident, path_str(), id_str)
13161316
}

src/librustc/hir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,7 @@ pub struct ImplItem {
18731873
pub defaultness: Defaultness,
18741874
pub attrs: HirVec<Attribute>,
18751875
pub generics: Generics,
1876-
pub node: ImplItemKind,
1876+
pub kind: ImplItemKind,
18771877
pub span: Span,
18781878
}
18791879

src/librustc/hir/print.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ impl<'a> State<'a> {
896896
self.print_outer_attributes(&ii.attrs);
897897
self.print_defaultness(ii.defaultness);
898898

899-
match ii.node {
899+
match ii.kind {
900900
hir::ImplItemKind::Const(ref ty, expr) => {
901901
self.print_associated_const(ii.ident, &ty, Some(expr), &ii.vis);
902902
}

src/librustc/ich/impls_hir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::ImplItem {
226226
defaultness,
227227
ref attrs,
228228
ref generics,
229-
ref node,
229+
ref kind,
230230
span
231231
} = *self;
232232

@@ -236,7 +236,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::ImplItem {
236236
defaultness.hash_stable(hcx, hasher);
237237
attrs.hash_stable(hcx, hasher);
238238
generics.hash_stable(hcx, hasher);
239-
node.hash_stable(hcx, hasher);
239+
kind.hash_stable(hcx, hasher);
240240
span.hash_stable(hcx, hasher);
241241
});
242242
}

src/librustc/infer/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ impl<'tcx> TyCtxt<'tcx> {
267267
}
268268

269269
fn impl_item_scope_tag(item: &hir::ImplItem) -> &'static str {
270-
match item.node {
270+
match item.kind {
271271
hir::ImplItemKind::Method(..) => "method body",
272272
hir::ImplItemKind::Const(..)
273273
| hir::ImplItemKind::OpaqueTy(..)

src/librustc/infer/error_reporting/nice_region_error/find_anon_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
3939
..
4040
})
4141
| Node::ImplItem(&hir::ImplItem {
42-
node: hir::ImplItemKind::Method(ref m, ..),
42+
kind: hir::ImplItemKind::Method(ref m, ..),
4343
..
4444
}) => &m.decl,
4545
_ => return None,

0 commit comments

Comments
 (0)