rust-lang/rust-clippy

Lint on method/struct fields sharing the same name

Open

#1481 opened on Jan 27, 2017

View on GitHub
 (7 comments) (0 reactions) (1 assignee)Rust (10,406 stars) (1,391 forks)batch import
A-lintL-styleT-middlegood first issue

Description

Would it be possible to lint on the situation in which a struct field shares a name with a struct method? For example, in the following situation:

struct Foo {
  bar: i32 
}

impl Foo {
  fn bar(self);
}

Contributor guide