Skip to content

Commit d4573c9

Browse files
committed
Rename TraitItem.node to TraitItem.kind
1 parent 17726f6 commit d4573c9

File tree

42 files changed

+82
-82
lines changed

Some content is hidden

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

42 files changed

+82
-82
lines changed

src/librustc/hir/intravisit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ pub fn walk_trait_item<'v, V: Visitor<'v>>(visitor: &mut V, trait_item: &'v Trai
856856
visitor.visit_ident(trait_item.ident);
857857
walk_list!(visitor, visit_attribute, &trait_item.attrs);
858858
visitor.visit_generics(&trait_item.generics);
859-
match trait_item.node {
859+
match trait_item.kind {
860860
TraitItemKind::Const(ref ty, default) => {
861861
visitor.visit_id(trait_item.hir_id);
862862
visitor.visit_ty(ty);

src/librustc/hir/lowering.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ impl<'a> LoweringContext<'a> {
469469
fn visit_trait_item(&mut self, item: &'tcx TraitItem) {
470470
self.lctx.allocate_hir_id_counter(item.id);
471471

472-
match item.node {
472+
match item.kind {
473473
TraitItemKind::Method(_, None) => {
474474
// Ignore patterns in trait methods without bodies
475475
self.with_hir_id_owner(None, |this| {

src/librustc/hir/lowering/item.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ impl LoweringContext<'_> {
818818
fn lower_trait_item(&mut self, i: &TraitItem) -> hir::TraitItem {
819819
let trait_item_def_id = self.resolver.definitions().local_def_id(i.id);
820820

821-
let (generics, node) = match i.node {
821+
let (generics, kind) = match i.kind {
822822
TraitItemKind::Const(ref ty, ref default) => (
823823
self.lower_generics(&i.generics, ImplTraitContext::disallowed()),
824824
hir::TraitItemKind::Const(
@@ -852,14 +852,14 @@ impl LoweringContext<'_> {
852852
}
853853
TraitItemKind::Type(ref bounds, ref default) => {
854854
let generics = self.lower_generics(&i.generics, ImplTraitContext::disallowed());
855-
let node = hir::TraitItemKind::Type(
855+
let kind = hir::TraitItemKind::Type(
856856
self.lower_param_bounds(bounds, ImplTraitContext::disallowed()),
857857
default
858858
.as_ref()
859859
.map(|x| self.lower_ty(x, ImplTraitContext::disallowed())),
860860
);
861861

862-
(generics, node)
862+
(generics, kind)
863863
},
864864
TraitItemKind::Macro(..) => bug!("macro item shouldn't exist at this point"),
865865
};
@@ -869,13 +869,13 @@ impl LoweringContext<'_> {
869869
ident: i.ident,
870870
attrs: self.lower_attrs(&i.attrs),
871871
generics,
872-
node,
872+
kind,
873873
span: i.span,
874874
}
875875
}
876876

877877
fn lower_trait_item_ref(&mut self, i: &TraitItem) -> hir::TraitItemRef {
878-
let (kind, has_default) = match i.node {
878+
let (kind, has_default) = match i.kind {
879879
TraitItemKind::Const(_, ref default) => {
880880
(hir::AssocItemKind::Const, default.is_some())
881881
}

src/librustc/hir/map/blocks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl MaybeFnLike for ast::ImplItem {
5252

5353
impl MaybeFnLike for ast::TraitItem {
5454
fn is_fn_like(&self) -> bool {
55-
match self.node {
55+
match self.kind {
5656
ast::TraitItemKind::Method(_, ast::TraitMethod::Provided(_)) => true,
5757
_ => false,
5858
}
@@ -230,7 +230,7 @@ impl<'a> FnLikeNode<'a> {
230230
}),
231231
_ => bug!("item FnLikeNode that is not fn-like"),
232232
},
233-
map::Node::TraitItem(ti) => match ti.node {
233+
map::Node::TraitItem(ti) => match ti.kind {
234234
ast::TraitItemKind::Method(ref sig, ast::TraitMethod::Provided(body)) => {
235235
method(ti.hir_id, ti.ident, sig, None, body, ti.span, &ti.attrs)
236236
}

src/librustc/hir/map/def_collector.rs

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

216216
fn visit_trait_item(&mut self, ti: &'a TraitItem) {
217-
let def_data = match ti.node {
217+
let def_data = match ti.kind {
218218
TraitItemKind::Method(..) | TraitItemKind::Const(..) =>
219219
DefPathData::ValueNs(ti.ident.as_interned_str()),
220220
TraitItemKind::Type(..) => {

src/librustc/hir/map/mod.rs

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

5959
Node::TraitItem(ref item) => {
60-
match item.node {
60+
match item.kind {
6161
TraitItemKind::Method(ref method_sig, _) => Some(&method_sig.decl),
6262
_ => None
6363
}
@@ -93,7 +93,7 @@ impl<'hir> Entry<'hir> {
9393
}
9494

9595
Node::TraitItem(item) => {
96-
match item.node {
96+
match item.kind {
9797
TraitItemKind::Const(_, Some(body)) |
9898
TraitItemKind::Method(_, TraitMethod::Provided(body)) => Some(body),
9999
_ => None
@@ -320,7 +320,7 @@ impl<'hir> Map<'hir> {
320320
}
321321
}
322322
Node::TraitItem(item) => {
323-
match item.node {
323+
match item.kind {
324324
TraitItemKind::Const(..) => DefKind::AssocConst,
325325
TraitItemKind::Method(..) => DefKind::Method,
326326
TraitItemKind::Type(..) => DefKind::AssocTy,
@@ -454,14 +454,14 @@ impl<'hir> Map<'hir> {
454454
pub fn body_owner_kind(&self, id: HirId) -> BodyOwnerKind {
455455
match self.get(id) {
456456
Node::Item(&Item { node: ItemKind::Const(..), .. }) |
457-
Node::TraitItem(&TraitItem { node: TraitItemKind::Const(..), .. }) |
457+
Node::TraitItem(&TraitItem { kind: TraitItemKind::Const(..), .. }) |
458458
Node::ImplItem(&ImplItem { kind: ImplItemKind::Const(..), .. }) |
459459
Node::AnonConst(_) => {
460460
BodyOwnerKind::Const
461461
}
462462
Node::Ctor(..) |
463463
Node::Item(&Item { node: ItemKind::Fn(..), .. }) |
464-
Node::TraitItem(&TraitItem { node: TraitItemKind::Method(..), .. }) |
464+
Node::TraitItem(&TraitItem { kind: TraitItemKind::Method(..), .. }) |
465465
Node::ImplItem(&ImplItem { kind: ImplItemKind::Method(..), .. }) => {
466466
BodyOwnerKind::Fn
467467
}
@@ -653,7 +653,7 @@ impl<'hir> Map<'hir> {
653653
..
654654
})
655655
| Node::TraitItem(&TraitItem {
656-
node: TraitItemKind::Const(..),
656+
kind: TraitItemKind::Const(..),
657657
..
658658
})
659659
| Node::ImplItem(&ImplItem {
@@ -826,7 +826,7 @@ impl<'hir> Map<'hir> {
826826
}
827827
},
828828
Node::TraitItem(ti) => {
829-
match ti.node {
829+
match ti.kind {
830830
TraitItemKind::Method(..) => true,
831831
_ => false,
832832
}
@@ -1326,7 +1326,7 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
13261326
}
13271327
}
13281328
Some(Node::TraitItem(ti)) => {
1329-
let kind = match ti.node {
1329+
let kind = match ti.kind {
13301330
TraitItemKind::Const(..) => "assoc constant",
13311331
TraitItemKind::Method(..) => "trait method",
13321332
TraitItemKind::Type(..) => "assoc type",

src/librustc/hir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,7 @@ pub struct TraitItem {
18301830
pub hir_id: HirId,
18311831
pub attrs: HirVec<Attribute>,
18321832
pub generics: Generics,
1833-
pub node: TraitItemKind,
1833+
pub kind: TraitItemKind,
18341834
pub span: Span,
18351835
}
18361836

src/librustc/hir/print.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ impl<'a> State<'a> {
858858
self.hardbreak_if_not_bol();
859859
self.maybe_print_comment(ti.span.lo());
860860
self.print_outer_attributes(&ti.attrs);
861-
match ti.node {
861+
match ti.kind {
862862
hir::TraitItemKind::Const(ref ty, default) => {
863863
let vis = Spanned { span: syntax_pos::DUMMY_SP,
864864
node: hir::VisibilityKind::Inherited };

src/librustc/ich/impls_hir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,15 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::TraitItem {
200200
ident,
201201
ref attrs,
202202
ref generics,
203-
ref node,
203+
ref kind,
204204
span
205205
} = *self;
206206

207207
hcx.hash_hir_item_like(|hcx| {
208208
ident.name.hash_stable(hcx, hasher);
209209
attrs.hash_stable(hcx, hasher);
210210
generics.hash_stable(hcx, hasher);
211-
node.hash_stable(hcx, hasher);
211+
kind.hash_stable(hcx, hasher);
212212
span.hash_stable(hcx, hasher);
213213
});
214214
}

src/librustc/infer/error_reporting/mod.rs

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

262262
fn trait_item_scope_tag(item: &hir::TraitItem) -> &'static str {
263-
match item.node {
263+
match item.kind {
264264
hir::TraitItemKind::Method(..) => "method body",
265265
hir::TraitItemKind::Const(..) | hir::TraitItemKind::Type(..) => "associated item",
266266
}

0 commit comments

Comments
 (0)