Open
Description
I tried this code:
#![no_std]
#![feature(vec_spare_capacity)]
extern crate alloc;
I expected to see this happen: No warning, because removing the extern crate gives an error:
error[E0635]: unknown feature `vec_spare_capacity`
--> tmp.rs:2:12
|
2 | #![feature(vec_spare_capacity)]
| ^^^^^^^^^^^^^^^^^^
Instead, this happened:
error: unused extern crate
--> tmp.rs:2:1
|
2 | extern crate alloc;
| ^^^^^^^^^^^^^^^^^^^ help: remove it
|
= note: requested on the command line with `-D unused-extern-crates`
I think either the lint shouldn't fire or the compiler should somehow know the available feature gates ahead of time.
Meta
rustc --version --verbose
:
rustc 1.53.0-nightly (138fd56cf 2021-04-02)
binary: rustc
commit-hash: 138fd56cf9598b4bf016634c768dca128a83a5d7
commit-date: 2021-04-02
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0