) -> Option<(hir::BodyId, Option<&hir::Ty>, Option<&hir::FnHeader>, Option<&hir::FnDecl>)> {
match tcx.hir().get(id) {
Node::Item(item) => {
- match item.node {
+ match item.kind {
hir::ItemKind::Const(ref ty, body) |
hir::ItemKind::Static(ref ty, _, body) =>
Some((body, Some(ty), None, None)),
}
if let Node::Item(item) = fcx.tcx.hir().get(fn_id) {
- if let ItemKind::Fn(_, _, ref generics, _) = item.node {
+ if let ItemKind::Fn(_, _, ref generics, _) = item.kind {
if !generics.params.is_empty() {
fcx.tcx.sess.span_err(
span,
}
if let Node::Item(item) = fcx.tcx.hir().get(fn_id) {
- if let ItemKind::Fn(_, _, ref generics, _) = item.node {
+ if let ItemKind::Fn(_, _, ref generics, _) = item.kind {
if !generics.params.is_empty() {
fcx.tcx.sess.span_err(
span,
}
}
- let prohibit_opaque = match item.node {
+ let prohibit_opaque = match item.kind {
ItemKind::OpaqueTy(hir::OpaqueTy { origin: hir::OpaqueTyOrigin::AsyncFn, .. }) |
ItemKind::OpaqueTy(hir::OpaqueTy { origin: hir::OpaqueTyOrigin::FnReturn, .. }) => {
let mut visitor = ProhibitOpaqueVisitor {
debug!("check_opaque_for_inheriting_lifetimes: prohibit_opaque={:?}", prohibit_opaque);
if prohibit_opaque {
- let is_async = match item.node {
+ let is_async = match item.kind {
ItemKind::OpaqueTy(hir::OpaqueTy { origin, .. }) => match origin {
hir::OpaqueTyOrigin::AsyncFn => true,
_ => false,
tcx.def_path_str(tcx.hir().local_def_id(it.hir_id))
);
let _indenter = indenter();
- match it.node {
+ match it.kind {
// Consts can play a role in type-checking, so they are included here.
hir::ItemKind::Static(..) => {
let def_id = tcx.hir().local_def_id(it.hir_id);
).emit();
}
- if let hir::ForeignItemKind::Fn(ref fn_decl, _, _) = item.node {
+ if let hir::ForeignItemKind::Fn(ref fn_decl, _, _) = item.kind {
require_c_abi_if_c_variadic(tcx, fn_decl, m.abi, item.span);
}
}
let node = self.tcx.hir().get(self.tcx.hir().get_parent_item(id));
match node {
Node::Item(&hir::Item {
- node: hir::ItemKind::Fn(_, _, _, body_id), ..
+ kind: hir::ItemKind::Fn(_, _, _, body_id), ..
}) |
Node::ImplItem(&hir::ImplItem {
kind: hir::ImplItemKind::Method(_, body_id), ..
fn get_node_fn_decl(&self, node: Node<'tcx>) -> Option<(&'tcx hir::FnDecl, ast::Ident, bool)> {
match node {
Node::Item(&hir::Item {
- ident, node: hir::ItemKind::Fn(ref decl, ..), ..
+ ident, kind: hir::ItemKind::Fn(ref decl, ..), ..
}) => {
// This is less than ideal, it will not suggest a return type span on any
// method called `main`, regardless of whether it is actually the entry point,
let mut msg = "call this function";
match hir.get_if_local(def_id) {
Some(Node::Item(hir::Item {
- node: ItemKind::Fn(.., body_id),
+ kind: ItemKind::Fn(.., body_id),
..
})) |
Some(Node::ImplItem(hir::ImplItem {
}
}
Some(Node::ForeignItem(hir::ForeignItem {
- node: hir::ForeignItemKind::Fn(_, idents, _),
+ kind: hir::ForeignItemKind::Fn(_, idents, _),
..
})) |
Some(Node::TraitItem(hir::TraitItem {