Skip to content

Commit

Permalink
Rollup merge of #101536 - GuillaumeGomez:is_doc_comment-doc, r=lqd
Browse files Browse the repository at this point in the history
Add documentation for Attr::is_doc_comment

The function name is very misleading, some explanations won't hurt.

r? `@lqd`
  • Loading branch information
matthiaskrgr authored Sep 7, 2022
2 parents 497e170 + 88fa621 commit 41e1830
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 41e1830

Please sign in to comment.