Open lopopolo opened 2 years ago
I agree that this is not good. I think that in general the concept of unstable lints is weird: lints are unstable already, so any addition of a lint could theoretically break your compilation if you have stuff like #[deny(warnings)]
. What you should do is cap lints either at allow or warn.
And if you really want to have unstable lints, then it should not be an error to use them but a warn-by-default lint, whether it's unknown_lints
or unstable_lints
or such.
The "unstable lints" mechanism has been added by bb6791502846b62e752c99396953e4db7739f28c, and there have been attempts to treat unstable lints as unknown in 885275207810dc0143b56bc4357461aa4c8ed07b , but it seems they were not enough or were regressed upon.
Also there is obviously nothing we can do about the unsafe_op_in_unsafe_fn
lint here, as it is already stable. we can only affect future lints.
I tried this code:
I expected to see this happen: The crate compiles on all Rust versions.
#![allow(unknown_lints)]
treats unstable lints as unknown on stable compilers.Instead, this happened: On versions where the
unsafe_op_in_unsafe_fn
lint is unstable, like Rust 1.48.0, the crate fails to compile.Meta
rustc --version --verbose
:Backtrace
```
```
This ticket is a re-filing of https://github.com/rust-lang/rust/issues/103698 which uses the correct issue template and includes a reproducer.