From 2bcbb25cb5463873591e779cbace39d9aef66a96 Mon Sep 17 00:00:00 2001 From: inquisitivecrystal <22333129+inquisitivecrystal@users.noreply.github.com> Date: Wed, 7 Jul 2021 17:42:03 -0700 Subject: [PATCH] Remove `missing_docs` lint on private 2.0 macros --- compiler/rustc_lint/src/builtin.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index b303f55cf772..24d9e8fc2396 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -571,6 +571,11 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc { self.check_missing_docs_attrs(cx, hir::CRATE_HIR_ID, krate.item.inner, "the", "crate"); for macro_def in krate.exported_macros { + // Non exported MBE 2.0 macros should be skipped + if !macro_def.ast.macro_rules && !cx.access_levels.is_exported(macro_def.hir_id()) { + continue; + } + let attrs = cx.tcx.hir().attrs(macro_def.hir_id()); let has_doc = attrs.iter().any(|a| has_doc(cx.sess(), a)); if !has_doc {