Skip to content

Commit

Permalink
Add documentation for Attr::is_doc_comment
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez authored Sep 7, 2022
1 parent e7c7aa7 commit 88fa621
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_ast/src/attr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ impl AttrItem {
}

impl Attribute {
/// Returns `true` if it is a sugared doc comment (`///` or `//!` for example).
/// So `#[doc = "doc"]` will return `false`.
pub fn is_doc_comment(&self) -> bool {
match self.kind {
AttrKind::Normal(..) => false,
Expand Down

0 comments on commit 88fa621

Please sign in to comment.