Skip to content

The wrong_self_convention lint should be applied to traits too #6307

Closed
@stanislav-tkach

Description

@stanislav-tkach

In the following code the wrong_self_convention is triggered for the S struct only (the to_a method), but not for the trait declaration (the to_b method):

struct S {}

impl S {
    fn to_a(self) {}
}

trait T: Sized {
    fn to_b(self) {}
}

Meta

  • cargo clippy -V: clippy 0.0.212 (18bf6b4 2020-10-07)
  • rustc -Vv:
    rustc 1.47.0 (18bf6b4f0 2020-10-07)
    binary: rustc
    commit-hash: 18bf6b4f01a6feaf7259ba7cdae58031af1b7b39
    commit-date: 2020-10-07
    host: x86_64-unknown-linux-gnu
    release: 1.47.0
    LLVM version: 11.0
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingC-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesI-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