-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.F-lint_reasons`#![feature(lint_reasons)]``#![feature(lint_reasons)]`L-unused_featuresLint: unused_featuresLint: unused_featuresT-langRelevant to the language teamRelevant to the language team
Description
I tried this code:
#![deny(warnings)]
#![allow(stable_features)]
#![feature(lint_reasons)]
#[allow(unused_variables, reason = "my reason")]
fn main() {
let x = ();
}I expected to see this happen: no error emitted
Instead, this happened: Error:
error: feature `lint_reasons` is declared but not used
--> src/main.rs:3:12
|
3 | #![feature(lint_reasons)]
| ^^^^^^^^^^^^
|
note: the lint level is defined here
--> src/main.rs:1:9
|
1 | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(unused_features)]` implied by `#[deny(warnings)]`
Meta
rustc --version --verbose:
rustc 1.96.0-nightly (80282b130 2026-03-06)
binary: rustc
commit-hash: 80282b130679a654eaa22f028a908c51be53d436
commit-date: 2026-03-06
host: x86_64-unknown-linux-gnu
release: 1.96.0-nightly
LLVM version: 22.1.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.F-lint_reasons`#![feature(lint_reasons)]``#![feature(lint_reasons)]`L-unused_featuresLint: unused_featuresLint: unused_featuresT-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.