Skip to content

Deprecation attribute on trait impl block is accepted but has no effect #78625

Closed
@m-ou-se

Description

@m-ou-se

The following code is accepted, but the #[deprecated] attribute has no effect:

struct X;

#[deprecated = "hoi"]
impl Default for X {
    fn default() -> Self {
        X
    }
}

(Reported to me by @de-vri-es)

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.D-papercutDiagnostics: An error or lint that needs small tweaks.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions