Skip to content
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

No way to allow an unknown lint on the command line #81906

Closed
tmandry opened this issue Feb 9, 2021 · 1 comment
Closed

No way to allow an unknown lint on the command line #81906

tmandry opened this issue Feb 9, 2021 · 1 comment
Labels
A-driver Area: rustc_driver that ties everything together into the `rustc` compiler C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@tmandry
Copy link
Member

tmandry commented Feb 9, 2021

When migrating a large codebase to a new compiler version, frequently there are new lints. In codebases that enable -Dwarnings, this causes a problem: we'd like to allow the new lint temporarily before fixing in-tree, but passing -Anew-lint-here to the old compiler gives us an error. If we can't upgrade the compiler and build flags in lock step, we are stuck.

-Aunknown-lints exists, but does not have the desired effect on the command line:

$ rustc -Aunknown-lints -Alegacy-derive-helpers hello.rs
error[E0602]: unknown lint: `legacy_derive_helpers`
  |
  = note: requested on the command line with `-A legacy_derive_helpers`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0602`.

Since the same problem that unknown-lints solves exists on the command line, I'd argue that this is a bug in the CLI.

As a corollary, it would be nice if we could do something like -Aunknown-lints -Alegacy-derive-helpers -Dunknown-lints to prevent misspellings elsewhere in the command line.

@tmandry tmandry added A-driver Area: rustc_driver that ties everything together into the `rustc` compiler C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 9, 2021
@tmandry tmandry changed the title There's no way to allow an unknown lint on the command line No way to allow an unknown lint on the command line Feb 9, 2021
@jyn514
Copy link
Member

jyn514 commented Feb 9, 2021

Duplicate of #74722.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-driver Area: rustc_driver that ties everything together into the `rustc` compiler C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants