forked from rust-lang/rust-clippy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[similar_names] don't raise if the first character is different
A lot of cases of the "noise" cases of `similar_names` come from two idents with a different first letter, which is easy enough to differentiate visually but causes this lint to be raised. Do not raise the lint in these cases, as long as the first character does not have a lookalike. Link: rust-lang#10926
- Loading branch information
Showing
3 changed files
with
32 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,64 @@ | ||
error: binding's name is too similar to existing binding | ||
--> $DIR/similar_names.rs:22:9 | ||
| | ||
LL | let bpple: i32; | ||
| ^^^^^ | ||
| | ||
note: existing binding defined here | ||
--> $DIR/similar_names.rs:20:9 | ||
| | ||
LL | let apple: i32; | ||
| ^^^^^ | ||
= note: `-D clippy::similar-names` implied by `-D warnings` | ||
= help: to override `-D warnings` add `#[allow(clippy::similar_names)]` | ||
|
||
error: binding's name is too similar to existing binding | ||
--> $DIR/similar_names.rs:25:9 | ||
| | ||
LL | let cpple: i32; | ||
| ^^^^^ | ||
| | ||
note: existing binding defined here | ||
--> $DIR/similar_names.rs:20:9 | ||
| | ||
LL | let apple: i32; | ||
| ^^^^^ | ||
|
||
error: binding's name is too similar to existing binding | ||
--> $DIR/similar_names.rs:50:9 | ||
--> $DIR/similar_names.rs:47:9 | ||
| | ||
LL | let bluby: i32; | ||
| ^^^^^ | ||
| | ||
note: existing binding defined here | ||
--> $DIR/similar_names.rs:49:9 | ||
--> $DIR/similar_names.rs:46:9 | ||
| | ||
LL | let blubx: i32; | ||
| ^^^^^ | ||
= note: `-D clippy::similar-names` implied by `-D warnings` | ||
= help: to override `-D warnings` add `#[allow(clippy::similar_names)]` | ||
|
||
error: binding's name is too similar to existing binding | ||
--> $DIR/similar_names.rs:55:9 | ||
--> $DIR/similar_names.rs:52:9 | ||
| | ||
LL | let coke: i32; | ||
| ^^^^ | ||
| | ||
note: existing binding defined here | ||
--> $DIR/similar_names.rs:53:9 | ||
--> $DIR/similar_names.rs:50:9 | ||
| | ||
LL | let cake: i32; | ||
| ^^^^ | ||
|
||
error: binding's name is too similar to existing binding | ||
--> $DIR/similar_names.rs:74:9 | ||
--> $DIR/similar_names.rs:71:9 | ||
| | ||
LL | let xyzeabc: i32; | ||
| ^^^^^^^ | ||
| | ||
note: existing binding defined here | ||
--> $DIR/similar_names.rs:72:9 | ||
--> $DIR/similar_names.rs:69:9 | ||
| | ||
LL | let xyz1abc: i32; | ||
| ^^^^^^^ | ||
|
||
error: binding's name is too similar to existing binding | ||
--> $DIR/similar_names.rs:79:9 | ||
--> $DIR/similar_names.rs:76:9 | ||
| | ||
LL | let parsee: i32; | ||
| ^^^^^^ | ||
| | ||
note: existing binding defined here | ||
--> $DIR/similar_names.rs:77:9 | ||
--> $DIR/similar_names.rs:74:9 | ||
| | ||
LL | let parser: i32; | ||
| ^^^^^^ | ||
|
||
error: binding's name is too similar to existing binding | ||
--> $DIR/similar_names.rs:101:16 | ||
--> $DIR/similar_names.rs:98:16 | ||
| | ||
LL | bpple: sprang, | ||
| ^^^^^^ | ||
| | ||
note: existing binding defined here | ||
--> $DIR/similar_names.rs:100:16 | ||
--> $DIR/similar_names.rs:97:16 | ||
| | ||
LL | apple: spring, | ||
| ^^^^^^ | ||
|
||
error: aborting due to 7 previous errors | ||
error: aborting due to 5 previous errors | ||
|