update rustdoc

This commit is contained in:
lcnr 2022-04-26 13:21:09 +02:00
parent 6c8265dc56
commit bae84a484c
5 changed files with 27 additions and 23 deletions

View file

@ -474,10 +474,9 @@ crate fn find_nearest_parent_module(tcx: TyCtxt<'_>, def_id: DefId) -> Option<De
///
/// This function exists because it runs on `hir::Attributes` whereas the other is a
/// `clean::Attributes` method.
crate fn has_doc_flag(attrs: ty::Attributes<'_>, flag: Symbol) -> bool {
attrs.iter().any(|attr| {
attr.has_name(sym::doc)
&& attr.meta_item_list().map_or(false, |l| rustc_attr::list_contains_name(&l, flag))
crate fn has_doc_flag(tcx: TyCtxt<'_>, did: DefId, flag: Symbol) -> bool {
tcx.get_attrs(did, sym::doc).any(|attr| {
attr.meta_item_list().map_or(false, |l| rustc_attr::list_contains_name(&l, flag))
})
}