Skip to content

Commit 73e8416

Browse files
authored
Merge pull request #3081 from mikerite/fix-3078
Fix #3078
2 parents d3f78d6 + c6074a9 commit 73e8416

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

clippy_lints/src/non_expressive_names.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ impl<'a, 'tcx: 'a, 'b> Visitor<'tcx> for SimilarNamesNameVisitor<'a, 'tcx, 'b> {
114114
_ => walk_pat(self, pat),
115115
}
116116
}
117+
fn visit_mac(&mut self, _mac: &Mac) {
118+
// do not check macs
119+
}
117120
}
118121

119122
fn get_whitelist(interned_name: &str) -> Option<&'static [&'static str]> {

tests/ui/non_expressive_names.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ fn issue2927() {
147147
format!("{:?}", 2);
148148
}
149149

150+
fn issue3078() {
151+
match "a" {
152+
stringify!(a) => {},
153+
_ => {}
154+
}
155+
}
156+
150157
struct Bar;
151158

152159
impl Bar {

tests/ui/non_expressive_names.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,21 +150,21 @@ error: consider choosing a more descriptive name
150150
| ^^^^^^^
151151

152152
error: consider choosing a more descriptive name
153-
--> $DIR/non_expressive_names.rs:154:13
153+
--> $DIR/non_expressive_names.rs:161:13
154154
|
155-
154 | let _1 = 1;
155+
161 | let _1 = 1;
156156
| ^^
157157

158158
error: consider choosing a more descriptive name
159-
--> $DIR/non_expressive_names.rs:155:13
159+
--> $DIR/non_expressive_names.rs:162:13
160160
|
161-
155 | let ____1 = 1;
161+
162 | let ____1 = 1;
162162
| ^^^^^
163163

164164
error: consider choosing a more descriptive name
165-
--> $DIR/non_expressive_names.rs:156:13
165+
--> $DIR/non_expressive_names.rs:163:13
166166
|
167-
156 | let __1___2 = 12;
167+
163 | let __1___2 = 12;
168168
| ^^^^^^^
169169

170170
error: aborting due to 17 previous errors

0 commit comments

Comments
 (0)