-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
New lints are not backwards compatible #12495
Comments
The manual way would be having Cargo avoiding to pass the flags for given versions. This is what we do for C in the Linux kernel (either testing if the flag itself is recognized or for the version), and what we would currently need to do for That infrastructure for skipping flags is something we would need to do anyway, even if this is in place, since other flags that are not diagnostics are not included in this "ignore if unknown" proposal, right? Thus one may just do it for diagnostics too instead of Is the intention that one has a CI build with the latest compiler and Also, related discussion on ignoring lints (when compiling with newer versions, unlike here which is about compiling with older versions) and lint stability: rust-lang/rust-clippy#11227 |
…r-errors refactor(lint): translate `RenamedOrRemovedLint` I was trying to address <rust-lang/cargo#12495> and found that maybe I should refactor relevant lints a bit. This PR translates `RenamedOrRemovedLint` into fluent file. To make diagnostic types clearer and easier to organize, this PR splits it into two structs. The second commit adds lifetime annotations for removing unnecessary clones. If people feel too noisy, we can revert such change. ### Possibly relevant UI tests: * `tests/ui/lint-removed*` * `tests/ui/lint-renamed*` * `tests/ui/rustdoc-renamed.rs` * `tests/rustdoc-ui/lints/unknown-renamed-lints.rs`
This should be resolved by rust-lang/rust#115387. One could simply add this and smile :)
If it is not, please comment below or reopen the issue. |
Problem
When a new lint is introduced, a user may want to start using it via the
[lints]
table. However, if they add it to the table, it will be a hard error for all versions of Rust before the lint was introduced. This can make it difficult to set the level of lints, where compared to using attributes which just generate a warning.Steps
Set up a project with:
Results in:
With no possibility to allow it (even with capped lints).
Possible Solution(s)
This may require a change in rustc (and thus this may be an issue for rust-lang/rust). I think unknown lints on the command-line should not generate an error to match the behavior of an unknown attribute, and should just generate an unknown_lints warning.
This has been the behavior since the beginning (well beyond 1.0). I don't think there was any motivation other than all CLI flags generated errors (like
-C foo
also generates an error).Notes
No response
Version
The text was updated successfully, but these errors were encountered: