-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Attribute doc methods #101752
Improve Attribute doc methods #101752
Conversation
sweet, @bors r+ rollup |
@@ -233,14 +233,20 @@ impl AttrItem { | |||
|
|||
impl Attribute { | |||
/// Returns `true` if it is a sugared doc comment (`///` or `//!` for example). | |||
/// So `#[doc = "doc"]` will return `false`. | |||
/// So `#[doc = "doc"]` (which is a doc comment) and `#[doc(...)]` (which is not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[doc = "doc"]
is not a doc comment, and not a comment at all, it's a doc attribute.
I'm not sure why this causes confusion, the function name tells exactly what it does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because ///
is a doc comment and syntactic sugar over #[doc = "..."]
, so the confusion is still quite strong.
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#101266 (translations(rustc_session): migrates rustc_session to use SessionDiagnostic - Final) - rust-lang#101737 (rustdoc: remove no-op CSS `.search-results .result-name > span`) - rust-lang#101752 (Improve Attribute doc methods) - rust-lang#101754 (Fix doc of log function) - rust-lang#101759 (:arrow_up: rust-analyzer) - rust-lang#101765 (Add documentation for TyCtxt::visibility) - rust-lang#101770 (Rustdoc-Json: Don't loose subitems of foreign traits.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
r? @lqd