Skip to content

Commit 19553ae

Browse files
committed
Auto merge of #3657 - roblabla:bugfix-missing-docs-global-asm, r=phansch
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
2 parents 11ba624 + 7920365 commit 19553ae

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

clippy_lints/src/missing_doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
133133
hir::ItemKind::Struct(..) => "a struct",
134134
hir::ItemKind::Trait(..) => "a trait",
135135
hir::ItemKind::TraitAlias(..) => "a trait alias",
136-
hir::ItemKind::GlobalAsm(..) => "an assembly blob",
137136
hir::ItemKind::Ty(..) => "a type alias",
138137
hir::ItemKind::Union(..) => "a union",
139138
hir::ItemKind::Existential(..) => "an existential type",
140139
hir::ItemKind::ExternCrate(..)
141140
| hir::ItemKind::ForeignMod(..)
141+
| hir::ItemKind::GlobalAsm(..)
142142
| hir::ItemKind::Impl(..)
143143
| hir::ItemKind::Use(..) => return,
144144
};

tests/ui/missing-doc.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// When denying at the crate level, be sure to not get random warnings from the
33
// injected intrinsics by the compiler.
44
#![allow(dead_code)]
5-
#![feature(associated_type_defaults)]
5+
#![feature(associated_type_defaults, global_asm)]
66

77
//! Some garbage docs for the crate here
88
#![doc = "More garbage"]
@@ -176,3 +176,6 @@ pub mod public_interface {
176176
}
177177

178178
fn main() {}
179+
180+
// Ensure global asm doesn't require documentation.
181+
global_asm! { "" }

0 commit comments

Comments
 (0)