Skip to content

Deprecated attribute on trait impls is useless #51470

Closed
@Havvy

Description

@Havvy

I'd expect the following code to warn, but it doesn't:

struct Struct;

trait Trait {
  fn f(&self);
}

#[deprecated(since="0.0.0" note="example deprecation")]
impl Struct for Trait {
  fn f(&self) {}
}

fn main() {
  Struct.f();
}

Note: It is an error to put the deprecated attribute on the fn f in the impl itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-trait-systemArea: Trait system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions