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

overhaul unused doc comments lint #57882

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
6 participants
@euclio
Copy link
Contributor

euclio commented Jan 24, 2019

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.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jan 24, 2019

r? @michaelwoerister

(rust_highfive has picked a reviewer for you, use r? to override)

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

michaelwoerister commented Jan 25, 2019

@estebank

This comment has been minimized.

Copy link
Contributor

estebank commented Jan 25, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 25, 2019

📌 Commit 871e460 has been approved by estebank

Centril added a commit to Centril/rust that referenced this pull request Jan 26, 2019

Rollup merge of rust-lang#57882 - euclio:unused-doc-attributes, r=est…
…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.

Centril added a commit to Centril/rust that referenced this pull request Jan 26, 2019

Rollup merge of rust-lang#57882 - euclio:unused-doc-attributes, r=est…
…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.

bors added a commit that referenced this pull request Jan 26, 2019

Auto merge of #57912 - Centril:rollup, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #57425 (std: Stabilize fixed-width integer atomics)
 - #57703 (Make MutexGuard's Debug implementation more useful.)
 - #57729 (extra testing of how NLL handles wildcard type `_`)
 - #57764 (Fix some minor warnings)
 - #57825 (un-deprecate mem::zeroed)
 - #57827 (Ignore aarch64 in simd-intrinsic-generic-reduction)
 - #57852 (Suggest removing leading left angle brackets.)
 - #57882 (overhaul unused doc comments lint)
 - #57908 (resolve: Fix span arithmetics in the import conflict error)

Failed merges:

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 26, 2019

☔️ The latest upstream changes (presumably #57726) made this pull request unmergeable. Please resolve the merge conflicts.

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 27, 2019

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout unused-doc-attributes (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self unused-doc-attributes --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
Auto-merging src/librustc_lint/lib.rs
CONFLICT (content): Merge conflict in src/librustc_lint/lib.rs
Auto-merging src/librustc_lint/builtin.rs
Auto-merging src/librustc/ty/mod.rs
Auto-merging src/librustc/ty/context.rs
Auto-merging src/librustc/hir/mod.rs
Auto-merging src/libcore/num/mod.rs
Automatic merge failed; fix conflicts and then commit the result.

@euclio euclio force-pushed the euclio:unused-doc-attributes branch from 871e460 to 75d30fd Jan 27, 2019

@euclio

This comment has been minimized.

Copy link
Contributor Author

euclio commented Jan 27, 2019

@estebank Rebased.

@estebank

This comment has been minimized.

Copy link
Contributor

estebank commented Jan 27, 2019

@bors try

@euclio let's verify how much this change will impact the ecosystem before we merge.

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 27, 2019

⌛️ Trying commit 75d30fd with merge 58c1b81...

bors added a commit that referenced this pull request Jan 27, 2019

Auto merge of #57882 - euclio:unused-doc-attributes, r=<try>
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.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 28, 2019

☀️ Test successful - checks-travis
State: approved= try=True

@euclio euclio force-pushed the euclio:unused-doc-attributes branch from 75d30fd to 930c6c8 Jan 31, 2019

@euclio

This comment has been minimized.

Copy link
Contributor Author

euclio commented Jan 31, 2019

@estebank rebased. Did we ever get a crater run going for this?

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 9, 2019

☔️ The latest upstream changes (presumably #58316) made this pull request unmergeable. Please resolve the merge conflicts.

euclio added some commits Jan 23, 2019

improve unused doc comment diagnostic reporting
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.
expand unused doc comment diagnostic
Report the diagnostic on macro expansions, and add a label indicating
why the comment is unused.

@euclio euclio force-pushed the euclio:unused-doc-attributes branch from 930c6c8 to 1b5f2c7 Feb 11, 2019

@euclio

This comment has been minimized.

Copy link
Contributor Author

euclio commented Feb 11, 2019

@estebank Rebased.

@estebank

This comment has been minimized.

Copy link
Contributor

estebank commented Feb 11, 2019

Did we ever get a crater run going for this?

No we didn't, sorry about that, but the prior try run should be representative enough that we don't need to run it again.

@craterbot run start=master#da6ab956e1002517803ecd38b904504a1223274b end=try#58c1b81ef6055246e8b6467f767b2e3c1ce4403b

@craterbot

This comment has been minimized.

Copy link
Collaborator

craterbot commented Feb 11, 2019

👌 Experiment pr-57882 created and queued.
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 12, 2019

☔️ The latest upstream changes (presumably #58341) made this pull request unmergeable. Please resolve the merge conflicts.

@craterbot

This comment has been minimized.

Copy link
Collaborator

craterbot commented Feb 13, 2019

🚧 Experiment pr-57882 is now running on agent aws-1.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot

This comment has been minimized.

Copy link
Collaborator

craterbot commented Feb 15, 2019

🎉 Experiment pr-57882 is completed!
📊 32 regressed and 19 fixed (50551 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@estebank

This comment has been minimized.

Copy link
Contributor

estebank commented Feb 15, 2019

The breakage is remarkably small. @euclio would you mind contacting the crates that are confirmed to be broken by this (like carboxyl and biscuit) with either tickets or PRs nudging them in the right direction before we merge?

@euclio

This comment has been minimized.

Copy link
Contributor Author

euclio commented Feb 15, 2019

Sure thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment