Queryify is_doc_hidden
It came up hot on some profiling of rustdoc I did, so hopefully turning it into a query will help.
This commit is contained in:
@@ -41,7 +41,7 @@ use rustc_macros::HashStable;
|
||||
use rustc_query_system::ich::StableHashingContext;
|
||||
use rustc_session::cstore::CrateStoreDyn;
|
||||
use rustc_span::symbol::{kw, Ident, Symbol};
|
||||
use rustc_span::{sym, Span};
|
||||
use rustc_span::Span;
|
||||
use rustc_target::abi::Align;
|
||||
|
||||
use std::hash::Hash;
|
||||
@@ -2125,14 +2125,6 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||
self.sess.contains_name(&self.get_attrs(did), attr)
|
||||
}
|
||||
|
||||
/// Determines whether an item is annotated with `doc(hidden)`.
|
||||
pub fn is_doc_hidden(self, did: DefId) -> bool {
|
||||
self.get_attrs(did)
|
||||
.iter()
|
||||
.filter_map(|attr| if attr.has_name(sym::doc) { attr.meta_item_list() } else { None })
|
||||
.any(|items| items.iter().any(|item| item.has_name(sym::hidden)))
|
||||
}
|
||||
|
||||
/// Returns `true` if this is an `auto trait`.
|
||||
pub fn trait_is_auto(self, trait_def_id: DefId) -> bool {
|
||||
self.trait_def(trait_def_id).has_auto_impl
|
||||
|
||||
Reference in New Issue
Block a user