Node::ImplItem(item) => &item.generics,
Node::Item(item) => {
- match item.node {
+ match item.kind {
ItemKind::Fn(.., ref generics, _)
| ItemKind::Impl(_, _, _, ref generics, ..)
| ItemKind::TyAlias(_, ref generics)
let it = tcx.hir().expect_item(item_id);
debug!("convert: item {} with id {}", it.ident, it.hir_id);
let def_id = tcx.hir().local_def_id(item_id);
- match it.node {
+ match it.kind {
// These don't define types.
hir::ItemKind::ExternCrate(_)
| hir::ItemKind::Use(..)
tcx.generics_of(def_id);
tcx.type_of(def_id);
tcx.predicates_of(def_id);
- if let hir::ItemKind::Fn(..) = it.node {
+ if let hir::ItemKind::Fn(..) = it.kind {
tcx.fn_sig(def_id);
}
}
};
let repr = ReprOptions::new(tcx, def_id);
- let (kind, variants) = match item.node {
+ let (kind, variants) = match item.kind {
ItemKind::Enum(ref def, _) => {
let mut distance_from_explicit = 0;
let variants = def.variants
_ => bug!("trait_node_id {} is not an item", trait_hir_id),
};
- let (generics, bounds) = match item.node {
+ let (generics, bounds) = match item.kind {
hir::ItemKind::Trait(.., ref generics, ref supertraits, _) => (generics, supertraits),
hir::ItemKind::TraitAlias(ref generics, ref supertraits) => (generics, supertraits),
_ => span_bug!(item.span, "super_predicates invoked on non-trait"),
let hir_id = tcx.hir().as_local_hir_id(def_id).unwrap();
let item = tcx.hir().expect_item(hir_id);
- let (is_auto, unsafety) = match item.node {
+ let (is_auto, unsafety) = match item.kind {
hir::ItemKind::Trait(is_auto, unsafety, ..) => (is_auto == hir::IsAuto::Yes, unsafety),
hir::ItemKind::TraitAlias(..) => (false, hir::Unsafety::Normal),
_ => span_bug!(item.span, "trait_def_of_item invoked on non-trait"),
}
_ => None,
},
- Node::Item(item) => match item.node {
+ Node::Item(item) => match item.kind {
hir::ItemKind::Fn(ref fn_decl, .., ref generics, _) => {
has_late_bound_regions(tcx, generics, fn_decl)
}
kind: hir::ExprKind::Closure(..),
..
}) => Some(tcx.closure_base_def_id(def_id)),
- Node::Item(item) => match item.node {
+ Node::Item(item) => match item.kind {
ItemKind::OpaqueTy(hir::OpaqueTy { impl_trait_fn, .. }) => impl_trait_fn,
_ => None,
},
Node::ImplItem(item) => &item.generics,
Node::Item(item) => {
- match item.node {
+ match item.kind {
ItemKind::Fn(.., ref generics, _) | ItemKind::Impl(_, _, _, ref generics, ..) => {
generics
}
},
Node::Item(item) => {
- match item.node {
+ match item.kind {
ItemKind::Static(ref ty, .., body_id)
| ItemKind::Const(ref ty, body_id) => {
if let hir::TyKind::Infer = ty.kind {
span_bug!(
item.span,
"compute_type_of_item: unexpected item type: {:?}",
- item.node
+ item.kind
);
}
}
..
})
| Item(hir::Item {
- node: ItemKind::Fn(decl, header, _, _),
+ kind: ItemKind::Fn(decl, header, _, _),
..
}) => match get_infer_ret_ty(&decl.output) {
Some(ty) => {
let icx = ItemCtxt::new(tcx, def_id);
let hir_id = tcx.hir().as_local_hir_id(def_id).unwrap();
- match tcx.hir().expect_item(hir_id).node {
+ match tcx.hir().expect_item(hir_id).kind {
hir::ItemKind::Impl(.., ref opt_trait_ref, _, _) => {
opt_trait_ref.as_ref().map(|ast_trait_ref| {
let selfty = tcx.type_of(def_id);
let hir_id = tcx.hir().as_local_hir_id(def_id).unwrap();
let is_rustc_reservation = tcx.has_attr(def_id, sym::rustc_reservation_impl);
let item = tcx.hir().expect_item(hir_id);
- match &item.node {
+ match &item.kind {
hir::ItemKind::Impl(_, hir::ImplPolarity::Negative, ..) => {
if is_rustc_reservation {
tcx.sess.span_err(item.span, "reservation impls can't be negative");
},
Node::Item(item) => {
- match item.node {
+ match item.kind {
ItemKind::Impl(_, _, defaultness, ref generics, ..) => {
if defaultness.is_default() {
is_default_impl_trait = tcx.impl_trait_ref(def_id);
// in trait checking. See `setup_constraining_predicates`
// for details.
if let Node::Item(&Item {
- node: ItemKind::Impl(..),
+ kind: ItemKind::Impl(..),
..
}) = node
{
fn static_mutability(tcx: TyCtxt<'_>, def_id: DefId) -> Option<hir::Mutability> {
match tcx.hir().get_if_local(def_id) {
Some(Node::Item(&hir::Item {
- node: hir::ItemKind::Static(_, mutbl, _), ..
+ kind: hir::ItemKind::Static(_, mutbl, _), ..
})) |
Some(Node::ForeignItem( &hir::ForeignItem {
node: hir::ForeignItemKind::Static(_, mutbl), ..