Use the rustc unknown lints attribute#1609
Merged
dconnolly merged 4 commits intoZcashFoundation:mainfrom Jan 19, 2021
Merged
Conversation
357cfca to
057f1c7
Compare
Contributor
Author
|
This change doesn't work, because the stable version of rustc doesn't include clippy in unknown_lints. We might have to use conditional compilation with rustc_version. But we should also check if any of these lints are known in the latest stable, so we can delete unknown_lints for them. |
057f1c7 to
d88cc2b
Compare
3a9e5e4 to
4ab633f
Compare
dconnolly
reviewed
Jan 19, 2021
122773b to
5a18325
Compare
Contributor
Author
|
I set this PR to auto-merge (rebase) when it's approved. I picked rebase so we keep a history of the multiple different steps we took to resolve the warnings. It's important for people who use nightly, and it's safe to merge immediately. |
The clippy unknown lints attribute was deprecated in nightly in rust-lang/rust#80524. The old lint name now produces a warning. Since we're using `allow(unknown_lints)` to suppress warnings, we need to add the canonical name, so we can continue to build without warnings on nightly. But we also need to keep the old name, so we can continue to build without warnings on stable. And therefore, we also need to disable the "removed lints" warning, otherwise we'll get warnings about the old name on nightly. We'll need to keep this transitional clippy config until rustc 1.51 is stable.
Contributor
Author
|
Oops, my local clippy wasn't checking tests, even though I said |
5a18325 to
b4ba2b5
Compare
teor2345
commented
Jan 19, 2021
teor2345
commented
Jan 19, 2021
teor2345
commented
Jan 19, 2021
848bf5f to
1a42052
Compare
dconnolly
approved these changes
Jan 19, 2021
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
The clippy unknown lints attribute was deprecated in nightly in rust-lang/rust#80524. The old lint name now produces a warning.
Solution
Eliminate as many lints as possible, then configure retained lints to avoid warnings on nightly and stable. That's a bit tricky, at least for the transition period.
Retained Lints
Since we're using
allow(unknown_lints)to suppress warnings, we need to add the canonical name, so we can continue to build without warnings on nightly.But we also need to keep the old name, so we can continue to build without warnings on stable.
And therefore, we also need to disable the "removed lints" warning, otherwise we'll get warnings about the old name on nightly.
We'll need to keep this transitional clippy config from nightly 2021-01-17 until rustc 1.51 is stable.
Review
This change is a low priority, unless your workflow depends on building without warnings on nightly.
Related Issues
rust-lang/rust#80524 - the deprecation PR