-
Notifications
You must be signed in to change notification settings - Fork 13.3k
overhaul unused doc comments lint #57882
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @estebank |
@bors r+ |
📌 Commit 871e460 has been approved by |
…ebank overhaul unused doc comments lint This PR contains a number of improvements to the `unused_doc_comments` lint. - Extends the span to cover the entire comment when using sugared doc comments. - Triggers the lint for all unused doc comments on a node, instead of just the first one. - Triggers the lint on macro expansions, and provides a help note explaining that doc comments must be expanded by the macro. - Adds a label pointing at the node that cannot be documented. Furthermore, this PR fixes any instances in rustc where a macro expansion was erroneously documented.
…ebank overhaul unused doc comments lint This PR contains a number of improvements to the `unused_doc_comments` lint. - Extends the span to cover the entire comment when using sugared doc comments. - Triggers the lint for all unused doc comments on a node, instead of just the first one. - Triggers the lint on macro expansions, and provides a help note explaining that doc comments must be expanded by the macro. - Adds a label pointing at the node that cannot be documented. Furthermore, this PR fixes any instances in rustc where a macro expansion was erroneously documented.
☔ The latest upstream changes (presumably #57726) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
871e460
to
75d30fd
Compare
@estebank Rebased. |
⌛ Trying commit 75d30fd9401bd8f341ca82626edf61ca8e4ddd28 with merge 58c1b81ef6055246e8b6467f767b2e3c1ce4403b... |
☀️ Test successful - checks-travis |
75d30fd
to
930c6c8
Compare
@estebank rebased. Did we ever get a crater run going for this? |
☔ The latest upstream changes (presumably #58316) made this pull request unmergeable. Please resolve the merge conflicts. |
930c6c8
to
1b5f2c7
Compare
@estebank Rebased. |
allow specifying attributes for tool lints Needed for clippy to fix `unused_doc_comments` warnings that will be exposed by rust-lang#57882 (and thus unblock it).
allow specifying attributes for tool lints Needed for clippy to fix `unused_doc_comments` warnings that will be exposed by rust-lang#57882 (and thus unblock it).
☔ The latest upstream changes (presumably #58505) made this pull request unmergeable. Please resolve the merge conflicts. |
b5fadf0
to
8edbc64
Compare
move lint documentation into macro invocations This PR moves lint documentation inside `declare_clippy_lint!` macro invocations, to avoid triggering the `unused_doc_comments` lint once it's modified in rust-lang/rust#57882. This PR is necessary to unblock that work, since the large number of warnings generated in `clippy_lints` causes Travis to hit the log length limit. This PR also updates the documentation and website generation script. It would be nice to get a clippy update in the Rust repo once this is merged. cc @phansch
☔ The latest upstream changes (presumably #58583) made this pull request unmergeable. Please resolve the merge conflicts. |
@euclio The Clippy submodule should now contain the changes to make this pass. |
Report all unused attributes on a given doc comment instead of just the first one, and extend the span of sugared doc comments to encompass the whole comment.
Report the diagnostic on macro expansions, and add a label indicating why the comment is unused.
8edbc64
to
daf80f7
Compare
@estebank Ok, let's give this another shot! |
@bors r+ |
📌 Commit daf80f7 has been approved by |
overhaul unused doc comments lint This PR contains a number of improvements to the `unused_doc_comments` lint. - Extends the span to cover the entire comment when using sugared doc comments. - Triggers the lint for all unused doc comments on a node, instead of just the first one. - Triggers the lint on macro expansions, and provides a help note explaining that doc comments must be expanded by the macro. - Adds a label pointing at the node that cannot be documented. Furthermore, this PR fixes any instances in rustc where a macro expansion was erroneously documented.
☀️ Test successful - checks-travis, status-appveyor |
Clarify unused_doc_comments note on macro invocations The previous error message used to say: <pre> /// doc ^^^^^^^ rustdoc does not generate documentation for <b>macros</b> </pre> Obviously we do generate documentation for macros, such as https://docs.rs/bitflags/1.2.1/bitflags/macro.bitflags.html. It's only macro invocations that don't get their own docs. This PR updates the message to say "rustdoc does not generate documentation for <b>macro invocations</b>". I observe that prior to rust-lang#69084 this used to say "rustdoc does not generate documentation for **macro expansions**", as implemented originally in rust-lang#57882. I don't have a preference between those but I made the commit before looking up the history. r? @Manishearth attn: @yaahc @euclio
This PR contains a number of improvements to the
unused_doc_comments
lint.Furthermore, this PR fixes any instances in rustc where a macro expansion was erroneously documented.