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

Fix #3078 #3081

Merged
merged 4 commits into from Aug 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions clippy_lints/src/non_expressive_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ impl<'a, 'tcx: 'a, 'b> Visitor<'tcx> for SimilarNamesNameVisitor<'a, 'tcx, 'b> {
_ => walk_pat(self, pat),
}
}
fn visit_mac(&mut self, _mac: &Mac) {
// do not check macs
}
}

fn get_whitelist(interned_name: &str) -> Option<&'static [&'static str]> {
Expand Down
7 changes: 7 additions & 0 deletions tests/ui/non_expressive_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ fn issue2927() {
format!("{:?}", 2);
}

fn issue3078() {
match "a" {
stringify!(a) => {},
_ => {}
}
}

struct Bar;

impl Bar {
Expand Down
12 changes: 6 additions & 6 deletions tests/ui/non_expressive_names.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,21 @@ error: consider choosing a more descriptive name
| ^^^^^^^

error: consider choosing a more descriptive name
--> $DIR/non_expressive_names.rs:154:13
--> $DIR/non_expressive_names.rs:161:13
|
154 | let _1 = 1;
161 | let _1 = 1;
| ^^

error: consider choosing a more descriptive name
--> $DIR/non_expressive_names.rs:155:13
--> $DIR/non_expressive_names.rs:162:13
|
155 | let ____1 = 1;
162 | let ____1 = 1;
| ^^^^^

error: consider choosing a more descriptive name
--> $DIR/non_expressive_names.rs:156:13
--> $DIR/non_expressive_names.rs:163:13
|
156 | let __1___2 = 12;
163 | let __1___2 = 12;
| ^^^^^^^

error: aborting due to 17 previous errors
Expand Down