Skip to content

Commit

Permalink
Prevent emitting missing_docs for pub extern crate
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jun 6, 2023
1 parent 51f714c commit 4711c30
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,12 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc {

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

Expand Down

0 comments on commit 4711c30

Please sign in to comment.