Skip to content

Commit

Permalink
Update doc(primitive) in rustc_resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 30, 2023
1 parent bcf8a8b commit f6035fb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions compiler/rustc_resolve/src/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,14 @@ pub fn inner_docs(attrs: &[ast::Attribute]) -> bool {
attrs.iter().find(|a| a.doc_str().is_some()).map_or(true, |a| a.style == ast::AttrStyle::Inner)
}

/// Has `#[doc(primitive)]` or `#[doc(keyword)]`.
/// Has `#[rustc_doc_primitive]` or `#[doc(keyword)]`.
pub fn has_primitive_or_keyword_docs(attrs: &[ast::Attribute]) -> bool {
for attr in attrs {
if attr.has_name(sym::doc) && let Some(items) = attr.meta_item_list() {
if attr.has_name(sym::rustc_doc_primitive) {
return true;
} else if attr.has_name(sym::doc) && let Some(items) = attr.meta_item_list() {
for item in items {
if item.has_name(sym::primitive) || item.has_name(sym::keyword) {
if item.has_name(sym::keyword) {
return true;
}
}
Expand Down

0 comments on commit f6035fb

Please sign in to comment.