-
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
Tracking issue for future-incompatibility lint forbidden_lint_groups
#81670
Comments
rust-lang/rust#81670 to fix compile warnings with stable 1.50.0
I'm not 100% sure this is the right place to report this but the error caused by this change is extremely hard to understand:
While this hints at this issue is in no way provides the information that it is caused by using |
Would it be possible to make this error a bit more "rust-like"? E.g. |
The warning message for this is not very helpful. The following code: #![forbid(unsafe_code, future_incompatible)]
#![warn(
missing_debug_implementations,
rust_2018_idioms,
trivial_casts,
unused_qualifications
)] Produces:
And frankly between that and this issue I am not sure what I am supposed to do? Am I supposed to turn |
Check: rust-lang/rust#81670 Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
Am I just tired or is this an oversight? Running the following clippy command results in the warnings generated in the followed code block: $ cargo clippy -- -F warnings -W future-incompatible
Am I reading this right? (Not sarcastic, I'm genuinely asking.) Is Is this intended behaviour? If yes, is there a proposed workaround or a better method to handle the errors better than what I am doing? Edit: Forgot to share the Rust version I am using. $ rustup toolchain list
stable-x86_64-unknown-linux-gnu (default)
1.62.0-x86_64-unknown-linux-gnu
$ cargo --version
cargo 1.69.0 (6e9a83356 2023-04-12)
$ rustc --version
rustc 1.69.0 (84c898d65 2023-04-16)
$ cargo clippy --version
clippy 0.1.69 (84c898d 2023-04-16) |
@thefossguy: i had the same warning today and got pointed to this issue: #76053 if this issue here gets stabilised then i presume that the bug has to be fixed first so as to not break the code which currently gets the invalid warning? |
* start adding serde feature * Finish adding serde derives * Switch from forbid to deny, false positive is resolved with newer machinery rust-lang/rust#81670 * ask codecov to ignore the derives * Fix some clippy warnings from newer rust version
forbidden_lint_groups
forbidden_lint_groups
This and #70819 existed next to each other tracking the same problem for years. :) Great to hear that there's a future-compat lint here now. I think it's been around long enough so we should turn it into a hard error soon. |
@rust-lang/lang this has been a future-compat warning for many years. It's also been tracked as a plain bug independently, in #70819. Any objections to making it a hard error? We currently have a hole in our #![forbid(dead_code)]
#![allow(dead_code)]
#![crate_type = "lib"]
fn foo() {} But this code actually gets accepted: #![forbid(unused)]
#![allow(unused)]
#![crate_type = "lib"]
fn foo() {} This is because This issue is tracking fixing that hole, and making both of the above examples behave the same. #133535 proposes to dial this up to show up in reports, and I propose that in 6 or 12 weeks, we make this a hard error on nightly. |
…, r=<try> [crater only] make forbidden_lint_groups a hard error This is to gather information for rust-lang#81670.
@rustbot labels -I-lang-nominated We talked about this in our triage meeting today. We're OK with bumping this to report in deps, and commented in: |
On making it a hard error soon, our vibe was positive on that. Please nominate the PR for that for us. |
Findings from the crater run in #133536 (crater report found here):
|
…ure-compat, r=davidtwco show forbidden_lint_groups in future-compat reports Part of rust-lang#81670. This has been a future-compat lint for a while, time to dial it up to show up in reports.
Rollup merge of rust-lang#133535 - RalfJung:forbidden_lint_groups-future-compat, r=davidtwco show forbidden_lint_groups in future-compat reports Part of rust-lang#81670. This has been a future-compat lint for a while, time to dial it up to show up in reports.
…t, r=davidtwco show forbidden_lint_groups in future-compat reports Part of rust-lang/rust#81670. This has been a future-compat lint for a while, time to dial it up to show up in reports.
…t, r=davidtwco show forbidden_lint_groups in future-compat reports Part of rust-lang/rust#81670. This has been a future-compat lint for a while, time to dial it up to show up in reports.
This is the summary issue for the
forbidden_lint_groups
future-compatibility warning and other related errors. The goal of
this page is describe why this change was made and how you can fix
code that is affected by it. It also provides a place to ask questions
or register a complaint if you feel the change should not be made. For
more information on the policy around future-compatibility warnings,
see our breaking change policy guidelines.
What is the warning for?
Due to a compiler bug, applying
forbid
to lint groups,previously had no effect. The bug is now fixed but instead of
enforcing
forbid
we issue this future-compatibility warningto avoid breaking existing crates.
Recommendations
If your crate is using
#![forbid(warnings)]
, we recommend that you change to#![deny(warnings)]
.When will this warning become a hard error?
At the beginning of each 6-week release cycle, the Rust compiler team
will review the set of outstanding future compatibility warnings and
nominate some of them for Final Comment Period. Toward the end of
the cycle, we will review any comments and make a final determination
whether to convert the warning into a hard error or remove it
entirely.
Once this is a hard error...
... we can possibly clean up #67885, since maybe flags and attributes can share the same logic then?
The text was updated successfully, but these errors were encountered: