pub(crate) fn has_doc_flag<F: Fn(&DocAttribute) -> bool>( tcx: TyCtxt<'_>, did: DefId, callback: F, ) -> bool
This function exists because it runs on hir::Attributes whereas the other is a clean::Attributes method.
hir::Attributes
clean::Attributes