-
Notifications
You must be signed in to change notification settings - Fork 106
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
Use the rustc unknown lints attribute #1609
Conversation
357cfca
to
057f1c7
Compare
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
122773b
to
5a18325
Compare
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.
Oops, my local clippy wasn't checking tests, even though I said |
5a18325
to
b4ba2b5
Compare
848bf5f
to
1a42052
Compare
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