-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
RFC: Prevent lint changes being a breaking change #1193
Conversation
Add a new flag to the compiler, `--cap-lints`, which set the maximum possible lint level for the entire crate (and cannot be overridden). Cargo will then pass `--cap-lints allow` to all upstream dependencies when compiling code.
# Drawbacks | ||
|
||
This RFC adds surface area to the command line of the compiler with a relatively | ||
obscure option `--cap-lints`. The option will almost never be passed by anything |
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.
We could hide it away in e.g. -Z
to keep it from polluting --help
.
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.
We do currently kinda have this already, the --help --verbose
page is a little longer than --help
. I'd also prefer to continue to consider -Z
as "unstable flags", aka flags that Cargo should avoid.
Big 👍 from me. |
+1 from me. |
``` | ||
|
||
For example when `--cap-lints allow` is passed, all instances of `#[warn]`, | ||
`#[deny]`, and `#[forbid] are ignored. If, however `--cap-lints warn` is passed |
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.
(`#[forbid] needs a closing backtick)
After being bit hard by |
👍 Alex! |
The tools team has decided to place this RFC in its final comment period. |
This reverts commit 00130cf. As mentioned in a regression report[1], this caused a notable amount of breakage. Because there's a plan to mitigate[2] this type of breakage, I'm reverting this until then. [1]: https://internals.rust-lang.org/t/new-crater-reports-1-1-stable-vs-beta-2015-07-10-and-nightly-2015-07-10/2358 [2]: rust-lang/rfcs#1193
This reverts commit 00130cf. As mentioned in a regression report[1], this caused a notable amount of breakage. Because there's a plan to mitigate[2] this type of breakage, I'm reverting this until then. [1]: https://internals.rust-lang.org/t/new-crater-reports-1-1-stable-vs-beta-2015-07-10-and-nightly-2015-07-10/2358 [2]: rust-lang/rfcs#1193
The consensus of the tools team is to merge this RFC, so I'm going to do so! |
This commit is an implementation of [RFC 1193][rfc] which adds the ability to the compiler to cap the lint level for the entire compilation session. This flag will ensure that no lints will go above this level, and Cargo will primarily use this flag passing `--cap-lints allow` to all upstream dependencies. [rfc]: rust-lang/rfcs#1193 Closes rust-lang#27259
This commit is an implementation of [RFC 1193][rfc] which adds the ability to the compiler to cap the lint level for the entire compilation session. This flag will ensure that no lints will go above this level, and Cargo will primarily use this flag passing `--cap-lints allow` to all upstream dependencies. [rfc]: rust-lang/rfcs#1193 Closes #27259
Add a new flag to the compiler,
--cap-lints
, which set the maximum possiblelint level for the entire crate (and cannot be overridden). Cargo will then pass
--cap-lints allow
to all upstream dependencies when compiling code.Fixes #1029.
Rendered