if_let_chain!{[
parent_impl != ast::CRATE_NODE_ID,
let hir::map::Node::NodeItem(item) = cx.tcx.hir.get(parent_impl),
- let hir::Item_::ItemImpl(_, _, _, Some(ref trait_ref), _, _) = item.node,
+ let hir::Item_::ItemImpl(_, _, _, _, Some(ref trait_ref), _, _) = item.node,
trait_ref.path.def.def_id() == trait_id
], { return; }}
implements_trait($cx, $ty, trait_id, &[$rty], None)
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Derive {
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
- if let ItemImpl(_, _, _, Some(ref trait_ref), _, _) = item.node {
+ if let ItemImpl(_, _, _, _, Some(ref trait_ref), _, _) = item.node {
let ty = cx.tcx.type_of(cx.tcx.hir.local_def_id(item.id));
let is_automatically_derived = is_automatically_derived(&*item.attrs);
use rustc::hir::map::Node::*;
let is_impl = if let Some(NodeItem(item)) = cx.tcx.hir.find(cx.tcx.hir.get_parent_node(nodeid)) {
- matches!(item.node, hir::ItemImpl(_, _, _, Some(_), _, _) | hir::ItemDefaultImpl(..))
+ matches!(item.node, hir::ItemImpl(_, _, _, _, Some(_), _, _) | hir::ItemDefaultImpl(..))
} else {
false
};
match item.node {
ItemTrait(_, _, _, ref trait_items) => check_trait_items(cx, item, trait_items),
- ItemImpl(_, _, _, None, _, ref impl_items) => check_impl_items(cx, item, impl_items),
+ ItemImpl(_, _, _, _, None, _, ref impl_items) => check_impl_items(cx, item, impl_items),
_ => (),
}
}
let hir::ImplItemKind::Method(ref sig, id) = implitem.node,
let Some(first_arg_ty) = sig.decl.inputs.get(0),
let Some(first_arg) = iter_input_pats(&sig.decl, cx.tcx.hir.body(id)).next(),
- let hir::ItemImpl(_, _, _, None, ref self_ty, _) = item.node,
+ let hir::ItemImpl(_, _, _, _, None, ref self_ty, _) = item.node,
], {
// check missing trait implementations
for &(method_name, n_args, self_kind, out_type, trait_name) in &TRAIT_METHODS {
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
if_let_chain! {[
- let ItemImpl(_, _, _, Some(ref trait_ref), _, ref impl_items) = item.node,
+ let ItemImpl(_, _, _, _, Some(ref trait_ref), _, ref impl_items) = item.node,
!is_automatically_derived(&*item.attrs),
let Some(eq_trait) = cx.tcx.lang_items.eq_trait(),
trait_ref.path.def.def_id() == eq_trait
if let Some(NodeImplItem(item)) = map.find(map.get_parent(expr.id)) {
// `Debug` impl
if let Some(NodeItem(item)) = map.find(map.get_parent(item.id)) {
- if let ItemImpl(_, _, _, Some(ref tr), _, _) = item.node {
+ if let ItemImpl(_, _, _, _, Some(ref tr), _, _) = item.node {
return match_path_old(&tr.path, &["Debug"]);
}
}
fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
if let ImplItemKind::Method(ref sig, _) = item.node {
if let Some(NodeItem(it)) = cx.tcx.hir.find(cx.tcx.hir.get_parent(item.id)) {
- if let ItemImpl(_, _, _, Some(_), _, _) = it.node {
+ if let ItemImpl(_, _, _, _, Some(_), _, _) = it.node {
return; // ignore trait impls
}
}
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Serde {
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
- if let ItemImpl(_, _, _, Some(ref trait_ref), _, ref items) = item.node {
+ if let ItemImpl(_, _, _, _, Some(ref trait_ref), _, ref items) = item.node {
let did = trait_ref.path.def.def_id();
if let Some(visit_did) = get_trait_def_id(cx, &paths::SERDE_DE_VISITOR) {
if did == visit_did {
fn check_fn(&mut self, cx: &LateContext, _: FnKind, decl: &FnDecl, _: &Body, _: Span, id: NodeId) {
// skip trait implementations, see #605
if let Some(map::NodeItem(item)) = cx.tcx.hir.find(cx.tcx.hir.get_parent(id)) {
- if let ItemImpl(_, _, _, Some(..), _, _) = item.node {
+ if let ItemImpl(_, _, _, _, Some(..), _, _) = item.node {
return;
}
}
hir::ItemDefaultImpl(_, ref _trait_ref) => {
println!("default impl");
},
- hir::ItemImpl(_, _, _, Some(ref _trait_ref), _, _) => {
+ hir::ItemImpl(_, _, _, _, Some(ref _trait_ref), _, _) => {
println!("trait impl");
},
- hir::ItemImpl(_, _, _, None, _, _) => {
+ hir::ItemImpl(_, _, _, _, None, _, _) => {
println!("impl");
},
}