Missing docs: don't require documenting Global Asm items.

global_asm! items cannot be documented, the lint still gets triggered
after adding documentation to the macro invocation. Furthermore, even
if we could add documentation to the AST node, rustdoc doesn't render
it anyways.

Playground example: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=5182df182f0ffbbab4c3107e43368ac3
This commit is contained in:
roblabla 2019-01-13 16:09:58 +00:00
parent ac10c56c71
commit 79203653d1
2 changed files with 5 additions and 2 deletions

View File

@ -133,12 +133,12 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
hir::ItemKind::Struct(..) => "a struct", hir::ItemKind::Struct(..) => "a struct",
hir::ItemKind::Trait(..) => "a trait", hir::ItemKind::Trait(..) => "a trait",
hir::ItemKind::TraitAlias(..) => "a trait alias", hir::ItemKind::TraitAlias(..) => "a trait alias",
hir::ItemKind::GlobalAsm(..) => "an assembly blob",
hir::ItemKind::Ty(..) => "a type alias", hir::ItemKind::Ty(..) => "a type alias",
hir::ItemKind::Union(..) => "a union", hir::ItemKind::Union(..) => "a union",
hir::ItemKind::Existential(..) => "an existential type", hir::ItemKind::Existential(..) => "an existential type",
hir::ItemKind::ExternCrate(..) hir::ItemKind::ExternCrate(..)
| hir::ItemKind::ForeignMod(..) | hir::ItemKind::ForeignMod(..)
| hir::ItemKind::GlobalAsm(..)
| hir::ItemKind::Impl(..) | hir::ItemKind::Impl(..)
| hir::ItemKind::Use(..) => return, | hir::ItemKind::Use(..) => return,
}; };

View File

@ -2,7 +2,7 @@
// When denying at the crate level, be sure to not get random warnings from the // When denying at the crate level, be sure to not get random warnings from the
// injected intrinsics by the compiler. // injected intrinsics by the compiler.
#![allow(dead_code)] #![allow(dead_code)]
#![feature(associated_type_defaults)] #![feature(associated_type_defaults, global_asm)]
//! Some garbage docs for the crate here //! Some garbage docs for the crate here
#![doc = "More garbage"] #![doc = "More garbage"]
@ -176,3 +176,6 @@ pub mod public_interface {
} }
fn main() {} fn main() {}
// Ensure global asm doesn't require documentation.
global_asm! { "" }