Verified Solution[rust-lang/rust] `unused_features` triggers on stable `lint_reasons` despite usage
Sponsored Content
### ROOT CAUSE
The `unused_features` lint incorrectly flags the `lint_reasons` feature as unused, even though it's required for the `reason` attribute. This is because the `lint_reasons` feature is stable (stabilized in Rust 1.66.0) and does not need to be gated in stable Rust. The presence of `#![feature(lint_reasons)]` triggers the lint, but the feature is already available.
### CODE FIX
Remove the `#![feature(lint_reasons)]` attribute since `lint_reasons` is stable and does not require gating. The `reason` attribute will still work because it's part of the stable language.
**Fixed Code:**
```rust
#![deny(warnings)]
#[allow(unused_variables, reason = "my reason")]
fn main() {
let x = ();
}
```
Deploy on DigitalOcean ($200 Credit)
Related Fixes
[StackOverflow/reactjs] Webpack 5 Web-Worker has the wrong path after build. React 18, Electron
[StackOverflow/python] Automate Python Script in Microsoft Power Automate
[golang/go] x/tools/gopls: add a way to provide gopls settings for the built-in MCP server