return true
}
- match item.node {
+ match item.kind {
hir::ItemKind::Fn(_, header, ..) if header.is_const() => {
return true;
}
if codegen_fn_attrs.requests_inline() || generics.requires_monomorphization(tcx) {
return true
}
- if let hir::ImplItemKind::Method(method_sig, _) = &impl_item.node {
+ if let hir::ImplItemKind::Method(method_sig, _) = &impl_item.kind {
if method_sig.header.is_const() {
return true
}
}
fn visit_expr(&mut self, expr: &'tcx hir::Expr) {
- let res = match expr.node {
+ let res = match expr.kind {
hir::ExprKind::Path(ref qpath) => {
Some(self.tables.qpath_res(qpath, expr.hir_id))
}
match self.tcx.hir().find(hir_id) {
Some(Node::Item(item)) => {
- match item.node {
+ match item.kind {
hir::ItemKind::Fn(..) =>
item_might_be_inlined(self.tcx, &item, self.tcx.codegen_fn_attrs(def_id)),
_ => false,
}
}
Some(Node::TraitItem(trait_method)) => {
- match trait_method.node {
+ match trait_method.kind {
hir::TraitItemKind::Const(_, ref default) => default.is_some(),
hir::TraitItemKind::Method(_, hir::TraitMethod::Provided(_)) => true,
hir::TraitItemKind::Method(_, hir::TraitMethod::Required(_)) |
}
}
Some(Node::ImplItem(impl_item)) => {
- match impl_item.node {
+ match impl_item.kind {
hir::ImplItemKind::Const(..) => true,
hir::ImplItemKind::Method(..) => {
let attrs = self.tcx.codegen_fn_attrs(def_id);
// type of the impl require inlining, this method
// does too.
let impl_hir_id = self.tcx.hir().as_local_hir_id(impl_did).unwrap();
- match self.tcx.hir().expect_item(impl_hir_id).node {
+ match self.tcx.hir().expect_item(impl_hir_id).kind {
hir::ItemKind::Impl(..) => {
let generics = self.tcx.generics_of(impl_did);
generics.requires_monomorphization(self.tcx)
// If we are building an executable, only explicitly extern
// types need to be exported.
if let Node::Item(item) = *node {
- let reachable = if let hir::ItemKind::Fn(_, header, ..) = item.node {
+ let reachable = if let hir::ItemKind::Fn(_, header, ..) = item.kind {
header.abi != Abi::Rust
} else {
false
match *node {
Node::Item(item) => {
- match item.node {
+ match item.kind {
hir::ItemKind::Fn(.., body) => {
let def_id = self.tcx.hir().local_def_id(item.hir_id);
if item_might_be_inlined(self.tcx,
}
}
Node::TraitItem(trait_method) => {
- match trait_method.node {
+ match trait_method.kind {
hir::TraitItemKind::Const(_, None) |
hir::TraitItemKind::Method(_, hir::TraitMethod::Required(_)) => {
// Keep going, nothing to get exported
}
}
Node::ImplItem(impl_item) => {
- match impl_item.node {
+ match impl_item.kind {
hir::ImplItemKind::Const(_, body) => {
self.visit_nested_body(body);
}
hir::ImplItemKind::TyAlias(_) => {}
}
}
- Node::Expr(&hir::Expr { node: hir::ExprKind::Closure(.., body, _, _), .. }) => {
+ Node::Expr(&hir::Expr { kind: hir::ExprKind::Closure(.., body, _, _), .. }) => {
self.visit_nested_body(body);
}
// Nothing to recurse on for these
}
// We need only trait impls here, not inherent impls, and only non-exported ones
- if let hir::ItemKind::Impl(.., Some(ref trait_ref), _, ref impl_item_refs) = item.node {
+ if let hir::ItemKind::Impl(.., Some(ref trait_ref), _, ref impl_item_refs) = item.kind {
if !self.access_levels.is_reachable(item.hir_id) {
self.worklist.extend(impl_item_refs.iter().map(|ii_ref| ii_ref.id.hir_id));