mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
Avoid more invocations of hir_crate query.
This commit is contained in:
parent
23d5457e6d
commit
3037c40e9a
@ -78,9 +78,7 @@ impl MissingDoc {
|
||||
return;
|
||||
}
|
||||
|
||||
let has_doc = attrs
|
||||
.iter()
|
||||
.any(|a| a.doc_str().is_some());
|
||||
let has_doc = attrs.iter().any(|a| a.doc_str().is_some());
|
||||
if !has_doc {
|
||||
span_lint(
|
||||
cx,
|
||||
@ -104,9 +102,9 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc {
|
||||
self.doc_hidden_stack.pop().expect("empty doc_hidden_stack");
|
||||
}
|
||||
|
||||
fn check_crate(&mut self, cx: &LateContext<'tcx>, krate: &'tcx hir::Crate<'_>) {
|
||||
fn check_crate(&mut self, cx: &LateContext<'tcx>, _: &'tcx hir::Crate<'_>) {
|
||||
let attrs = cx.tcx.hir().attrs(hir::CRATE_HIR_ID);
|
||||
self.check_missing_docs_attrs(cx, attrs, krate.module().inner, "the", "crate");
|
||||
self.check_missing_docs_attrs(cx, attrs, cx.tcx.hir().root_module().inner, "the", "crate");
|
||||
}
|
||||
|
||||
fn check_item(&mut self, cx: &LateContext<'tcx>, it: &'tcx hir::Item<'_>) {
|
||||
|
Loading…
Reference in New Issue
Block a user