-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
#[deprecated] lint doesn't trigger when overriding deprecated method #98990
Copy link
Copy link
Open
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-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-bugCategory: This is a bug.Category: This is a bug.I-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.L-deprecatedLint: deprecatedLint: deprecatedT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-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-bugCategory: This is a bug.Category: This is a bug.I-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.L-deprecatedLint: deprecatedLint: deprecatedT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This doesn't give any warnings, even though std::error::Error::description is deprecated:
It seems like this is a deliberate decision:
rust/compiler/rustc_passes/src/stability.rs
Lines 763 to 764 in 3dcb616
Substituting that first
NoneforSome(impl_item_ref.id.hir_id())makes it work.Doing so results in the lint triggering in exactly one place in
std:rust/library/std/src/error.rs
Lines 605 to 609 in 3dcb616
That's because in all other cases, we have
#[allow(deprecated)]there:rust/library/std/src/error.rs
Lines 597 to 602 in 3dcb616
Which is suprising, as that lint doesn't tigger there, making that
#[allow]unnecessary.It seems as if it used to be necessary in the past, but now no longer is.
Did #[deprecated] trigger on overrides in the past? Was that behavior changed on purpose? Or is it a bug that it doesn't do that anymore?