Skip to content

Commit 590ae0e

Browse files
committed
Auto merge of #64813 - varkor:node-to-kind, r=Centril
Rename `*.node` to `*.kind`, and `hair::Pattern*` to `hair::Pat*` In both `ast::Expr` and `hir::Expr`: - Rename `Expr.node` to `Expr.kind`. - Rename `Pat.node` to `Pat.kind`. - Rename `ImplItem.node` to `ImplItem.kind`. - Rename `Lit.node` to `Lit.kind`. - Rename `TraitItem.node` to `TraitItem.kind`. - Rename `Ty.node` to `Ty.kind`. - Rename `Stmt.node` to `Stmt.kind`. - Rename `Item.node` to `Item.kind`. - Rename `ForeignItem.node` to `ForeignItem.kind`. - Rename `MetaItem.node` to `MetaItem.kind`. Also: - Rename `hair::FieldPattern` to `hair::FieldPat`. - Rename `hair::PatternKind` to `hair::PatKind`. - Rename `hair::PatternRange` to `hair::PatRange`. - Rename `PatternContext` to `PatCtxt`. - Rename `PatternTypeProjection` to `PatTyProj`. - Rename `hair::Pattern` to `hair::Pat`. These two sets of changes are grouped together to aid with merging. The only changes are renamings. r? @petrochenkov
2 parents 59367b0 + 80b63dd commit 590ae0e

File tree

177 files changed

+1574
-1587
lines changed

Some content is hidden

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

177 files changed

+1574
-1587
lines changed

src/librustc/hir/check_attr.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl Display for Target {
6565

6666
impl Target {
6767
pub(crate) fn from_item(item: &hir::Item) -> Target {
68-
match item.node {
68+
match item.kind {
6969
hir::ItemKind::ExternCrate(..) => Target::ExternCrate,
7070
hir::ItemKind::Use(..) => Target::Use,
7171
hir::ItemKind::Static(..) => Target::Static,
@@ -262,7 +262,7 @@ impl CheckAttrVisitor<'tcx> {
262262

263263
fn check_stmt_attributes(&self, stmt: &hir::Stmt) {
264264
// When checking statements ignore expressions, they will be checked later
265-
if let hir::StmtKind::Local(ref l) = stmt.node {
265+
if let hir::StmtKind::Local(ref l) = stmt.kind {
266266
for attr in l.attrs.iter() {
267267
if attr.check_name(sym::inline) {
268268
self.check_inline(attr, &stmt.span, Target::Statement);
@@ -280,7 +280,7 @@ impl CheckAttrVisitor<'tcx> {
280280
}
281281

282282
fn check_expr_attributes(&self, expr: &hir::Expr) {
283-
let target = match expr.node {
283+
let target = match expr.kind {
284284
hir::ExprKind::Closure(..) => Target::Closure,
285285
_ => Target::Expression,
286286
};
@@ -333,7 +333,7 @@ impl Visitor<'tcx> for CheckAttrVisitor<'tcx> {
333333
}
334334

335335
fn is_c_like_enum(item: &hir::Item) -> bool {
336-
if let hir::ItemKind::Enum(ref def, _) = item.node {
336+
if let hir::ItemKind::Enum(ref def, _) = item.kind {
337337
for variant in &def.variants {
338338
match variant.data {
339339
hir::VariantData::Unit(..) => { /* continue */ }

src/librustc/hir/intravisit.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ pub fn walk_param<'v, V: Visitor<'v>>(visitor: &mut V, param: &'v Param) {
465465
pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) {
466466
visitor.visit_vis(&item.vis);
467467
visitor.visit_ident(item.ident);
468-
match item.node {
468+
match item.kind {
469469
ItemKind::ExternCrate(orig_name) => {
470470
visitor.visit_id(item.hir_id);
471471
if let Some(orig_name) = orig_name {
@@ -594,7 +594,7 @@ pub fn walk_variant<'v, V: Visitor<'v>>(visitor: &mut V,
594594
pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
595595
visitor.visit_id(typ.hir_id);
596596

597-
match typ.node {
597+
match typ.kind {
598598
TyKind::Slice(ref ty) => {
599599
visitor.visit_ty(ty)
600600
}
@@ -696,7 +696,7 @@ pub fn walk_assoc_type_binding<'v, V: Visitor<'v>>(visitor: &mut V,
696696

697697
pub fn walk_pat<'v, V: Visitor<'v>>(visitor: &mut V, pattern: &'v Pat) {
698698
visitor.visit_id(pattern.hir_id);
699-
match pattern.node {
699+
match pattern.kind {
700700
PatKind::TupleStruct(ref qpath, ref children, _) => {
701701
visitor.visit_qpath(qpath, pattern.hir_id, pattern.span);
702702
walk_list!(visitor, visit_pat, children);
@@ -743,7 +743,7 @@ pub fn walk_foreign_item<'v, V: Visitor<'v>>(visitor: &mut V, foreign_item: &'v
743743
visitor.visit_vis(&foreign_item.vis);
744744
visitor.visit_ident(foreign_item.ident);
745745

746-
match foreign_item.node {
746+
match foreign_item.kind {
747747
ForeignItemKind::Fn(ref function_declaration, ref param_names, ref generics) => {
748748
visitor.visit_generics(generics);
749749
visitor.visit_fn_decl(function_declaration);
@@ -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);
@@ -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);
@@ -974,7 +974,7 @@ pub fn walk_block<'v, V: Visitor<'v>>(visitor: &mut V, block: &'v Block) {
974974

975975
pub fn walk_stmt<'v, V: Visitor<'v>>(visitor: &mut V, statement: &'v Stmt) {
976976
visitor.visit_id(statement.hir_id);
977-
match statement.node {
977+
match statement.kind {
978978
StmtKind::Local(ref local) => visitor.visit_local(local),
979979
StmtKind::Item(item) => visitor.visit_nested_item(item),
980980
StmtKind::Expr(ref expression) |
@@ -992,7 +992,7 @@ pub fn walk_anon_const<'v, V: Visitor<'v>>(visitor: &mut V, constant: &'v AnonCo
992992
pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
993993
visitor.visit_id(expression.hir_id);
994994
walk_list!(visitor, visit_attribute, expression.attrs.iter());
995-
match expression.node {
995+
match expression.kind {
996996
ExprKind::Box(ref subexpression) => {
997997
visitor.visit_expr(subexpression)
998998
}

0 commit comments

Comments
 (0)