+ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
+ let headers = check_attrs(cx, &self.valid_idents, &item.attrs);
+ match item.kind {
+ hir::ItemKind::Fn(ref sig, ..) => {
+ lint_for_missing_headers(cx, item.hir_id, item.span, sig, headers);
+ },
+ hir::ItemKind::Impl(_, _, _, _, ref trait_ref, ..) => {
+ self.in_trait_impl = trait_ref.is_some();
+ },
+ _ => {},
+ }
+ }
+
+ fn check_item_post(&mut self, _cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
+ if let hir::ItemKind::Impl(..) = item.kind {
+ self.in_trait_impl = false;
+ }
+ }
+
+ fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::TraitItem) {
+ let headers = check_attrs(cx, &self.valid_idents, &item.attrs);
+ if let hir::TraitItemKind::Method(ref sig, ..) = item.kind {
+ lint_for_missing_headers(cx, item.hir_id, item.span, sig, headers);
+ }
+ }
+
+ fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::ImplItem) {
+ let headers = check_attrs(cx, &self.valid_idents, &item.attrs);
+ if self.in_trait_impl {