-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #75903 - jyn514:lint-refactor, r=GuillaumeGomez
Warn about unknown or renamed lints in rustdoc 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.
- Loading branch information
Showing
6 changed files
with
58 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#![deny(unknown_lints)] | ||
//~^ NOTE lint level is defined | ||
#![deny(renamed_and_removed_lints)] | ||
//~^ NOTE lint level is defined | ||
#![deny(x)] | ||
//~^ ERROR unknown lint | ||
#![deny(intra_doc_link_resolution_failure)] | ||
//~^ ERROR lint `intra_doc_link_resolution_failure` has been renamed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
error: unknown lint: `x` | ||
--> $DIR/unknown-renamed-lints.rs:5:9 | ||
| | ||
LL | #![deny(x)] | ||
| ^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/unknown-renamed-lints.rs:1:9 | ||
| | ||
LL | #![deny(unknown_lints)] | ||
| ^^^^^^^^^^^^^ | ||
|
||
error: lint `intra_doc_link_resolution_failure` has been renamed to `broken_intra_doc_links` | ||
--> $DIR/unknown-renamed-lints.rs:7:9 | ||
| | ||
LL | #![deny(intra_doc_link_resolution_failure)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `broken_intra_doc_links` | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/unknown-renamed-lints.rs:3:9 | ||
| | ||
LL | #![deny(renamed_and_removed_lints)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: Compilation failed, aborting rustdoc | ||
|
||
error: aborting due to 3 previous errors | ||
|