unused-features only warns unused non-language features
For the following snippet, rustc only warns about rustc_privat being unused:
#![feature(rustc_private)]
#![feature(box_syntax)]
#![feature(trace_macros)]
#![feature(slicing_syntax)]
#![feature(log_syntax)]
fn main() {}
According to the documentation, check_unused_or_stable_features only checks unused non-langauge features, but it is the only place that emits UNSUSED_FEATURES.
I would like to work on a patch for this issue. Would it make sense to collect language feature usage in
synatx::feature_gate::PostExpansionVisitorand check for unused language features in ``synatx::feature_gate::check_crate`?Florian Hahn at 2015-03-19 20:51:14
Triage: today, this says that
slicing_syntaxis stable, but only complains aboutrustc_private. Removing that and leavingbox_syntax,trace_macros, andlog_syntaxactually compiles with no warnings whatsoever, even though they don't appear to be used?Steve Klabnik at 2016-06-06 20:06:00
Some more undetected ones:
#![feature(slice_patterns)] #![feature(inclusive_range_syntax)] #![feature(type_ascription)] #![feature(asm)] #![feature(stmt_expr_attributes)] #![feature(conservative_impl_trait)] #![feature(const_fn)]leonardo-m at 2017-08-20 17:29:50
When enabling incremental compilation we removed the global state that contained all used unstable features and thus had to remove the unused features warning.
bjorn3 at 2023-07-15 13:08:42