Skip to content

Commit 2884762

Browse files
GuillaumeGomezMark-Simulacrum
authored andcommitted
Prevent emitting missing_docs for pub extern crate
1 parent 7bb6185 commit 2884762

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compiler/rustc_lint/src/builtin.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,12 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc {
548548

549549
fn check_item(&mut self, cx: &LateContext<'_>, it: &hir::Item<'_>) {
550550
// Previously the Impl and Use types have been excluded from missing docs,
551-
// so we will continue to exclude them for compatibility
552-
if let hir::ItemKind::Impl(..) | hir::ItemKind::Use(..) = it.kind {
551+
// so we will continue to exclude them for compatibility.
552+
//
553+
// The documentation on `ExternCrate` is not used at the moment so no need to warn for it.
554+
if let hir::ItemKind::Impl(..) | hir::ItemKind::Use(..) | hir::ItemKind::ExternCrate(_) =
555+
it.kind
556+
{
553557
return;
554558
}
555559

0 commit comments

Comments
 (0)