Skip to content
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

The wrong_self_convention lint should be applied to traits too #6307

Closed
stanislav-tkach opened this issue Nov 8, 2020 · 1 comment · Fixed by #6316
Closed

The wrong_self_convention lint should be applied to traits too #6307

stanislav-tkach opened this issue Nov 8, 2020 · 1 comment · Fixed by #6316
Labels
C-bug Category: Clippy is not doing the correct thing C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages I-false-negative Issue: The lint should have been triggered on code, but wasn't

Comments

@stanislav-tkach
Copy link
Contributor

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
    
@stanislav-tkach stanislav-tkach added the C-bug Category: Clippy is not doing the correct thing label Nov 8, 2020
@giraffate
Copy link
Contributor

@rustbot modify labels: +L-enhancement

@rustbot rustbot added the C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages label Nov 9, 2020
@phansch phansch added the I-false-negative Issue: The lint should have been triggered on code, but wasn't label Dec 18, 2020
@bors bors closed this as completed in 9f9e9f7 Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages I-false-negative Issue: The lint should have been triggered on code, but wasn't
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants