mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
Auto merge of #7546 - mgeier:patch-1, r=giraffate
similar_names: allow "iter" and "item" changelog: [`similar_names`] no longer complains about `iter` and `item` being too similar
This commit is contained in:
commit
62f4187ed0
3 changed files with 6 additions and 2 deletions
|
@ -126,6 +126,7 @@ const ALLOWED_TO_BE_SIMILAR: &[&[&str]] = &[
|
|||
&["qpath", "path"],
|
||||
&["lit", "lint"],
|
||||
&["wparam", "lparam"],
|
||||
&["iter", "item"],
|
||||
];
|
||||
|
||||
struct SimilarNamesNameVisitor<'a, 'tcx, 'b>(&'b mut SimilarNamesLocalVisitor<'a, 'tcx>);
|
||||
|
|
|
@ -76,6 +76,9 @@ fn main() {
|
|||
// names often used in win32 code (for example WindowProc)
|
||||
let wparam: i32;
|
||||
let lparam: i32;
|
||||
|
||||
let iter: i32;
|
||||
let item: i32;
|
||||
}
|
||||
|
||||
fn foo() {
|
||||
|
|
|
@ -72,13 +72,13 @@ LL | let parser: i32;
|
|||
| ^^^^^^
|
||||
|
||||
error: binding's name is too similar to existing binding
|
||||
--> $DIR/similar_names.rs:85:16
|
||||
--> $DIR/similar_names.rs:88:16
|
||||
|
|
||||
LL | bpple: sprang,
|
||||
| ^^^^^^
|
||||
|
|
||||
note: existing binding defined here
|
||||
--> $DIR/similar_names.rs:84:16
|
||||
--> $DIR/similar_names.rs:87:16
|
||||
|
|
||||
LL | apple: spring,
|
||||
| ^^^^^^
|
||||
|
|
Loading…
Reference in a new issue