diff options
| author | bors <bors@rust-lang.org> | 2019-09-27 10:05:38 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-09-27 10:05:38 +0000 |
| commit | 590ae0ec4d0c782f7cf97cff7474dc4012c1b615 (patch) | |
| tree | 6599f55c2c1113952f9a1d369773392252304b6e /src/librustc/ty | |
| parent | 59367b074f1523353dddefa678ffe3cac9fd4e50 (diff) | |
| parent | 80b63ddca59b16ca503f2f8306e9200102745426 (diff) | |
| download | rust-590ae0ec4d0c782f7cf97cff7474dc4012c1b615.tar.gz rust-590ae0ec4d0c782f7cf97cff7474dc4012c1b615.zip | |
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
Diffstat (limited to 'src/librustc/ty')
| -rw-r--r-- | src/librustc/ty/context.rs | 6 | ||||
| -rw-r--r-- | src/librustc/ty/mod.rs | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index 0d369aaa878..3c511cb4d18 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -603,7 +603,7 @@ impl<'tcx> TypeckTables<'tcx> { pub fn is_method_call(&self, expr: &hir::Expr) -> bool { // Only paths and method calls/overloaded operators have // entries in type_dependent_defs, ignore the former here. - if let hir::ExprKind::Path(_) = expr.node { + if let hir::ExprKind::Path(_) = expr.kind { return false; } @@ -1141,7 +1141,7 @@ impl<'tcx> TyCtxt<'tcx> { None => return Bound::Unbounded, }; for meta in attr.meta_item_list().expect("rustc_layout_scalar_valid_range takes args") { - match meta.literal().expect("attribute takes lit").node { + match meta.literal().expect("attribute takes lit").kind { ast::LitKind::Int(a, _) => return Bound::Included(a), _ => span_bug!(attr.span, "rustc_layout_scalar_valid_range expects int arg"), } @@ -1543,7 +1543,7 @@ impl<'tcx> TyCtxt<'tcx> { let hir_id = self.hir().as_local_hir_id(scope_def_id).unwrap(); match self.hir().get(hir_id) { Node::Item(item) => { - match item.node { + match item.kind { ItemKind::Fn(..) => { /* `type_of_def_id()` will work */ } _ => { return None; diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index bd5ac5e5ab4..f107af0cd07 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -3164,7 +3164,7 @@ fn associated_item(tcx: TyCtxt<'_>, def_id: DefId) -> AssocItem { let parent_id = tcx.hir().get_parent_item(id); let parent_def_id = tcx.hir().local_def_id(parent_id); let parent_item = tcx.hir().expect_item(parent_id); - match parent_item.node { + match parent_item.kind { hir::ItemKind::Impl(.., ref impl_item_refs) => { if let Some(impl_item_ref) = impl_item_refs.iter().find(|i| i.id.hir_id == id) { let assoc_item = tcx.associated_item_from_impl_item_ref(parent_def_id, @@ -3189,7 +3189,7 @@ fn associated_item(tcx: TyCtxt<'_>, def_id: DefId) -> AssocItem { span_bug!(parent_item.span, "unexpected parent of trait or impl item or item not found: {:?}", - parent_item.node) + parent_item.kind) } #[derive(Clone, HashStable)] @@ -3221,7 +3221,7 @@ fn adt_sized_constraint(tcx: TyCtxt<'_>, def_id: DefId) -> AdtSizedConstraint<'_ fn associated_item_def_ids(tcx: TyCtxt<'_>, def_id: DefId) -> &[DefId] { let id = tcx.hir().as_local_hir_id(def_id).unwrap(); let item = tcx.hir().expect_item(id); - match item.node { + match item.kind { hir::ItemKind::Trait(.., ref trait_item_refs) => { tcx.arena.alloc_from_iter( trait_item_refs.iter() @@ -3262,7 +3262,7 @@ fn trait_of_item(tcx: TyCtxt<'_>, def_id: DefId) -> Option<DefId> { pub fn is_impl_trait_defn(tcx: TyCtxt<'_>, def_id: DefId) -> Option<DefId> { if let Some(hir_id) = tcx.hir().as_local_hir_id(def_id) { if let Node::Item(item) = tcx.hir().get(hir_id) { - if let hir::ItemKind::OpaqueTy(ref opaque_ty) = item.node { + if let hir::ItemKind::OpaqueTy(ref opaque_ty) = item.kind { return opaque_ty.impl_trait_fn; } } |
