Skip to content

derivable_impls FN when enum is qualified with Self #15536

@profetia

Description

@profetia

Summary

derivable_impls FN when enum is qualified with Self in its impl of Default

Lint Name

derivable_impls

Reproducer

I tried this code:

#[derive(Copy, Clone)]
enum Bar {
    A,
    B,
}

impl Default for Bar {
    fn default() -> Self {
        Self::A
    }
}

I expected to see this happen:

The lint is triggered for Bar

Instead, this happened:

Nothing

Version


Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn't

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions