<p dir="auto">Features like <code class="notranslate">thread_local</code> or <code class="notranslate">unsafe_no_drop_flag</code> or <code class="notranslate">box_syntax</code>, which are needed to use language features, are not caught by the <code class="notranslate">unused_feature</code> lint.</p>
<p dir="auto">Perhaps we should add some more robust usage-checking?</p>
<p dir="auto">For the following snippet, rustc only warns about <code class="notranslate">rustc_privat</code> being unused:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#![feature(rustc_private)]
#![feature(box_syntax)]
#![feature(trace_macros)]
#![feature(slicing_syntax)]
#![feature(log_syntax)]

fn main() {}"><pre class="notranslate"><code class="notranslate">#![feature(rustc_private)]
#![feature(box_syntax)]
#![feature(trace_macros)]
#![feature(slicing_syntax)]
#![feature(log_syntax)]

fn main() {}
</code></pre></div>
<p dir="auto">According to the documentation, <a href="https://github.com/rust-lang/rust/blob/master/src/librustc/middle/stability.rs#L570">check_unused_or_stable_features</a> only checks unused non-langauge features, but it is the only place that emits <code class="notranslate">UNSUSED_FEATURES</code>.</p>