Open
Description
I tried this code:
#![forbid(unused_extern_crates)]
#![warn(unused_extern_crates)]
fn main() {}
I expected to see this happen: an error that can be disabled via --cap-lints=warn
Instead, this happened: a hard error
> rustc temp.rs --cap-lints=warn
error[E0453]: warn(unused_extern_crates) incompatible with previous forbid in same scope
--> temp.rs:2:9
|
1 | #![forbid(unused_extern_crates)]
| ---------------- `forbid` level set here
2 | #![warn(unused_extern_crates)]
| ^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
After writing this up, looking back through the history (#77534, #70819) it appears this is fixing a regression, but given that this has been accepted by the stable compiler for over 3 years at this point, maybe it's still worth having a deprecation period? (This was noticed by a user on the discord as their code started failing to compile).
Meta
> rustc --version --verbose
rustc 1.49.0-nightly (91a79fb29 2020-10-07)
binary: rustc
commit-hash: 91a79fb29ac78d057d04dbe86be13d5dcc64309a
commit-date: 2020-10-07
host: x86_64-unknown-linux-gnu
release: 1.49.0-nightly
LLVM version: 11.0