Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename *.node to *.kind, and hair::Pattern* to hair::Pat* #64813

Merged
merged 19 commits into from
Sep 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/librustc/hir/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl Display for Target {

impl Target {
pub(crate) fn from_item(item: &hir::Item) -> Target {
match item.node {
match item.kind {
hir::ItemKind::ExternCrate(..) => Target::ExternCrate,
hir::ItemKind::Use(..) => Target::Use,
hir::ItemKind::Static(..) => Target::Static,
Expand Down Expand Up @@ -262,7 +262,7 @@ impl CheckAttrVisitor<'tcx> {

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

fn check_expr_attributes(&self, expr: &hir::Expr) {
let target = match expr.node {
let target = match expr.kind {
hir::ExprKind::Closure(..) => Target::Closure,
_ => Target::Expression,
};
Expand Down Expand Up @@ -333,7 +333,7 @@ impl Visitor<'tcx> for CheckAttrVisitor<'tcx> {
}

fn is_c_like_enum(item: &hir::Item) -> bool {
if let hir::ItemKind::Enum(ref def, _) = item.node {
if let hir::ItemKind::Enum(ref def, _) = item.kind {
for variant in &def.variants {
match variant.data {
hir::VariantData::Unit(..) => { /* continue */ }
Expand Down
18 changes: 9 additions & 9 deletions src/librustc/hir/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ pub fn walk_param<'v, V: Visitor<'v>>(visitor: &mut V, param: &'v Param) {
pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) {
visitor.visit_vis(&item.vis);
visitor.visit_ident(item.ident);
match item.node {
match item.kind {
ItemKind::ExternCrate(orig_name) => {
visitor.visit_id(item.hir_id);
if let Some(orig_name) = orig_name {
Expand Down Expand Up @@ -594,7 +594,7 @@ pub fn walk_variant<'v, V: Visitor<'v>>(visitor: &mut V,
pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
visitor.visit_id(typ.hir_id);

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

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

match foreign_item.node {
match foreign_item.kind {
ForeignItemKind::Fn(ref function_declaration, ref param_names, ref generics) => {
visitor.visit_generics(generics);
visitor.visit_fn_decl(function_declaration);
Expand Down Expand Up @@ -856,7 +856,7 @@ pub fn walk_trait_item<'v, V: Visitor<'v>>(visitor: &mut V, trait_item: &'v Trai
visitor.visit_ident(trait_item.ident);
walk_list!(visitor, visit_attribute, &trait_item.attrs);
visitor.visit_generics(&trait_item.generics);
match trait_item.node {
match trait_item.kind {
TraitItemKind::Const(ref ty, default) => {
visitor.visit_id(trait_item.hir_id);
visitor.visit_ty(ty);
Expand Down Expand Up @@ -905,7 +905,7 @@ pub fn walk_impl_item<'v, V: Visitor<'v>>(visitor: &mut V, impl_item: &'v ImplIt
ref defaultness,
ref attrs,
ref generics,
ref node,
ref kind,
span: _,
} = *impl_item;

Expand All @@ -914,7 +914,7 @@ pub fn walk_impl_item<'v, V: Visitor<'v>>(visitor: &mut V, impl_item: &'v ImplIt
visitor.visit_defaultness(defaultness);
walk_list!(visitor, visit_attribute, attrs);
visitor.visit_generics(generics);
match *node {
match *kind {
ImplItemKind::Const(ref ty, body) => {
visitor.visit_id(impl_item.hir_id);
visitor.visit_ty(ty);
Expand Down Expand Up @@ -974,7 +974,7 @@ pub fn walk_block<'v, V: Visitor<'v>>(visitor: &mut V, block: &'v Block) {

pub fn walk_stmt<'v, V: Visitor<'v>>(visitor: &mut V, statement: &'v Stmt) {
visitor.visit_id(statement.hir_id);
match statement.node {
match statement.kind {
StmtKind::Local(ref local) => visitor.visit_local(local),
StmtKind::Item(item) => visitor.visit_nested_item(item),
StmtKind::Expr(ref expression) |
Expand All @@ -992,7 +992,7 @@ pub fn walk_anon_const<'v, V: Visitor<'v>>(visitor: &mut V, constant: &'v AnonCo
pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
visitor.visit_id(expression.hir_id);
walk_list!(visitor, visit_attribute, expression.attrs.iter());
match expression.node {
match expression.kind {
ExprKind::Box(ref subexpression) => {
visitor.visit_expr(subexpression)
}
Expand Down
Loading