-
Notifications
You must be signed in to change notification settings - Fork 13.3k
#[deprecated] lint doesn't trigger when overriding deprecated method #98990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
cc @rust-lang/libs-api, should the #[deprecated] lint trigger here or not? |
(reposting #98991 (comment) here as well) I'm not sure what happened here, but the lack of tests for this is worrying (and may explain how this happened, if it was accidental). EDIT: much more comprehensive analysis posted in #98991 (comment). |
I just ran into this. I'd like to guide my users away from implementing one trait function to new ones in a backwards-compatible way. My thinking was:
I was expecting to have users (the trait provides a plugin-like functionality, so has many external users outside the crate) to see a deprecation warning that they should no longer implement this function but a new one instead. |
@rustbot ping libs-api (see #98990 (comment)) |
Sorry for the long delay in this being talked about! We talked about this in today's @rust-lang/lang meeting, and those present (myself, @traviscross, and (representing libs-api) @Amanieu) were all generally in favor. We did feel this needs an FCP, though. Please do provide a PR implementing this, mark it I-lang-nominated, and we'll FCP it. |
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
None
forSome(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?
The text was updated successfully, but these errors were encountered: