Skip to content
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

Warn about unknown or renamed lints in rustdoc #75903

Merged
merged 4 commits into from
Aug 26, 2020

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Aug 25, 2020

Fixes #75884.
This is best reviewed one commit at a time.
r? @GuillaumeGomez

Originally I tried to do a much broader refactoring that got rid of init_lints altogether. My reasoning is that now the lints aren't being run anymore (after #73566), there's no need to ignore them explicitly. But it seems there are still some lints that aren't affected by setting lint_mod to a no-op:

deny(pub_use_of_private_extern_crate)
deny(const_err)
warn(unused_imports)

(there are possibly more, these are just the ones that failed in the rustdoc test suite).

Some of these seem like we really should be warning about, but that's a much larger change and I don't propose to make it here. So for the time being, this just adds the unknown_lints and renamed_or_removed_lints passes to the list of lints rustdoc warns about.

This way the rustdoc field names are the same as the rustc field names.
@jyn514 jyn514 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Aug 25, 2020
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 25, 2020
@jyn514 jyn514 changed the title Warn about unknown or renamed lints Warn about unknown or renamed lints in rustdoc Aug 25, 2020
@@ -257,7 +257,7 @@ where
.filter_map(|lint| {
// Permit feature-gated lints to avoid feature errors when trying to
// allow all lints.
if lint.name == warnings_lint_name || lint.feature_gate.is_some() {
if lint.name == warnings_lint_name || lint.feature_gate.is_some() || allowed_lints.iter().any(|l| lint.name == l) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised: normally you don't need this check here... Maybe it's because it's part of HardwiredLints?

Copy link
Member Author

@jyn514 jyn514 Aug 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is the thing I was confused about on discord. I'm not sure exactly why it's different, just that it is.

Originally I tried to do a much broader refactoring that got rid of `init_lints` altogether. My reasoning is that now the lints aren't being run anymore (after rust-lang#73566), there's no need to ignore them explicitly. But it seems there are still some lints that aren't affected by setting `lint_mod` to a no-op:

```
deny(pub_use_of_private_extern_crate)
deny(const_err)
warn(unused_imports)
```

(there are possibly more, these are just the ones that failed in the rustdoc test suite).

Some of these seem like we really should be warning about, but that's a much larger change and I don't propose to make it here. So for the time being, this just adds the `unknown_lints` and `renamed_or_removed_lints` passes to the list of lints rustdoc warns about.
@GuillaumeGomez
Copy link
Member

Thanks!

@bors: r+

@bors
Copy link
Contributor

bors commented Aug 25, 2020

📌 Commit e11b3ee has been approved by GuillaumeGomez

@bors
Copy link
Contributor

bors commented Aug 25, 2020

🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 25, 2020
@bors
Copy link
Contributor

bors commented Aug 26, 2020

⌛ Testing commit e11b3ee with merge 1f2dd3b...

@bors
Copy link
Contributor

bors commented Aug 26, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: GuillaumeGomez
Pushing 1f2dd3b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 26, 2020
@bors bors merged commit 1f2dd3b into rust-lang:master Aug 26, 2020
@rust-log-analyzer
Copy link
Collaborator

Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@jyn514 jyn514 deleted the lint-refactor branch August 26, 2020 18:48
@cuviper cuviper added this to the 1.48.0 milestone Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rustdoc does not warn about unknown, renamed, or removed lints
6 participants