- fn name(&self) -> &'static str {
- "LargeEnumVariant"
- }
-}
-
-impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LargeEnumVariant {
- fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &Item) {
- let did = cx.tcx.hir().local_def_id_from_hir_id(item.hir_id);
- if let ItemKind::Enum(ref def, _) = item.node {
- let ty = cx.tcx.type_of(did);
+impl<'tcx> LateLintPass<'tcx> for LargeEnumVariant {
+ fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
+ if in_external_macro(cx.tcx.sess, item.span) {
+ return;
+ }
+ if let ItemKind::Enum(ref def, _) = item.kind {
+ let ty = cx.tcx.type_of(item.def_id);