Auto merge of #107136 - petrochenkov:dochidden, r=cjgillot
rustc_metadata: Encode `doc(hidden)` flag to metadata To retrieve these flags rustdoc currently has to mass decode full attributes for items in the whole crate tree, so it's better to pre-compute it in advance. This is especially important for short-term performance of https://github.com/rust-lang/rust/pull/107054 because resolver cannot use memoization of query results yet.
This commit is contained in:
commit
5bef91c6e9
10 changed files with 52 additions and 18 deletions
|
|
@ -2498,14 +2498,7 @@ impl Import {
|
|||
}
|
||||
|
||||
pub(crate) fn imported_item_is_doc_hidden(&self, tcx: TyCtxt<'_>) -> bool {
|
||||
match self.source.did {
|
||||
Some(did) => tcx
|
||||
.get_attrs(did, sym::doc)
|
||||
.filter_map(ast::Attribute::meta_item_list)
|
||||
.flatten()
|
||||
.has_word(sym::hidden),
|
||||
None => false,
|
||||
}
|
||||
self.source.did.map_or(false, |did| tcx.is_doc_hidden(did))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue