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:
bors 2021-08-12 08:16:50 +00:00
commit 62f4187ed0
3 changed files with 6 additions and 2 deletions

View file

@ -126,6 +126,7 @@ const ALLOWED_TO_BE_SIMILAR: &[&[&str]] = &[
&["qpath", "path"], &["qpath", "path"],
&["lit", "lint"], &["lit", "lint"],
&["wparam", "lparam"], &["wparam", "lparam"],
&["iter", "item"],
]; ];
struct SimilarNamesNameVisitor<'a, 'tcx, 'b>(&'b mut SimilarNamesLocalVisitor<'a, 'tcx>); struct SimilarNamesNameVisitor<'a, 'tcx, 'b>(&'b mut SimilarNamesLocalVisitor<'a, 'tcx>);

View file

@ -76,6 +76,9 @@ fn main() {
// names often used in win32 code (for example WindowProc) // names often used in win32 code (for example WindowProc)
let wparam: i32; let wparam: i32;
let lparam: i32; let lparam: i32;
let iter: i32;
let item: i32;
} }
fn foo() { fn foo() {

View file

@ -72,13 +72,13 @@ LL | let parser: i32;
| ^^^^^^ | ^^^^^^
error: binding's name is too similar to existing binding 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, LL | bpple: sprang,
| ^^^^^^ | ^^^^^^
| |
note: existing binding defined here note: existing binding defined here
--> $DIR/similar_names.rs:84:16 --> $DIR/similar_names.rs:87:16
| |
LL | apple: spring, LL | apple: spring,
| ^^^^^^ | ^^^^^^