-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Backwards compatibility for tool/clippy lints #53762
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
Merged
+231
−51
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9521dee
Add tests for backward compat
flip1995 ce173c1
Add deprecated_name argument to the register lint group functions
flip1995 3720557
Implement backwards compatibility for tool_lints
flip1995 a59da03
Add hint for cfg_attr and fix test
flip1995 b776579
Update tests
flip1995 9cbe518
Fix typo and small mistake
flip1995 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,8 +1,62 @@ | ||
warning: item is named 'lintme' | ||
--> $DIR/lint_tool_test.rs:19:1 | ||
warning: lint name `test_lint` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore | ||
--> $DIR/lint_tool_test.rs:18:23 | ||
| | ||
LL | fn lintme() { } //~ WARNING item is named 'lintme' | ||
LL | #![cfg_attr(foo, warn(test_lint))] | ||
| ^^^^^^^^^ help: change it to: `clippy::test_lint` | ||
| | ||
= note: #[warn(renamed_and_removed_lints)] on by default | ||
|
||
warning: lint name `clippy_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore | ||
--> $DIR/lint_tool_test.rs:21:9 | ||
| | ||
LL | #![deny(clippy_group)] | ||
| ^^^^^^^^^^^^ help: change it to: `clippy::group` | ||
|
||
warning: lint name `test_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore | ||
--> $DIR/lint_tool_test.rs:35:9 | ||
| | ||
LL | #[allow(test_group)] | ||
| ^^^^^^^^^^ help: change it to: `clippy::test_group` | ||
|
||
warning: unknown lint: `this_lint_does_not_exist` | ||
--> $DIR/lint_tool_test.rs:37:8 | ||
| | ||
LL | #[deny(this_lint_does_not_exist)] //~ WARNING unknown lint: `this_lint_does_not_exist` | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: #[warn(unknown_lints)] on by default | ||
|
||
warning: lint name `test_lint` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore | ||
--> $DIR/lint_tool_test.rs:18:23 | ||
| | ||
LL | #![cfg_attr(foo, warn(test_lint))] | ||
| ^^^^^^^^^ help: change it to: `clippy::test_lint` | ||
|
||
error: item is named 'lintme' | ||
--> $DIR/lint_tool_test.rs:24:1 | ||
| | ||
LL | fn lintme() { } //~ ERROR item is named 'lintme' | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: #[warn(clippy::test_lint)] on by default | ||
note: lint level defined here | ||
--> $DIR/lint_tool_test.rs:21:9 | ||
| | ||
LL | #![deny(clippy_group)] | ||
| ^^^^^^^^^^^^ | ||
= note: #[deny(clippy::test_lint)] implied by #[deny(clippy::group)] | ||
|
||
error: item is named 'lintmetoo' | ||
--> $DIR/lint_tool_test.rs:32:5 | ||
| | ||
LL | fn lintmetoo() { } //~ ERROR item is named 'lintmetoo' | ||
| ^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: lint level defined here | ||
--> $DIR/lint_tool_test.rs:21:9 | ||
| | ||
LL | #![deny(clippy_group)] | ||
| ^^^^^^^^^^^^ | ||
= note: #[deny(clippy::test_group)] implied by #[deny(clippy::group)] | ||
|
||
error: aborting due to 2 previous errors | ||
|
Submodule clippy
updated
from d99cea to 9abf6f
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The reason that this warning is emitted twice is the note
#[warn(renamed_and_removed_lints)] on by default
, which only appears on the first occurrence of lint warnings. That doesn't effect theUNKNOWN_LINTS
lint though.. 🤔