-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Conversation
This way the rustdoc field names are the same as the rustc field names.
src/librustdoc/core.rs
Outdated
@@ -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) { |
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.
I'm surprised: normally you don't need this check here... Maybe it's because it's part of HardwiredLints
?
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.
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.
Thanks! @bors: r+ |
📌 Commit e11b3ee has been approved by |
🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened |
☀️ Test successful - checks-actions, checks-azure |
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 |
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 settinglint_mod
to a no-op:(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
andrenamed_or_removed_lints
passes to the list of lints rustdoc warns about.