1
Fork 0

Rollup merge of #112343 - GuillaumeGomez:extern-crate-missing-docs, r=notriddle

Prevent emitting `missing_docs` for `pub extern crate`

Fixes #112308.

r? `@notriddle`
This commit is contained in:
Matthias Krüger 2023-06-06 22:00:20 +02:00 committed by GitHub
commit 38ddff516c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 28 deletions

View file

@ -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;
}