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

Allow wparam and lparam in similar_names #7255

Merged
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
1 change: 1 addition & 0 deletions clippy_lints/src/non_expressive_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const ALLOWED_TO_BE_SIMILAR: &[&[&str]] = &[
&["args", "arms"],
&["qpath", "path"],
&["lit", "lint"],
&["wparam", "lparam"],
];

struct SimilarNamesNameVisitor<'a, 'tcx, 'b>(&'b mut SimilarNamesLocalVisitor<'a, 'tcx>);
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/similar_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ fn main() {
let rx1: i32;
let tx_cake: i32;
let rx_cake: i32;

// names often used in win32 code (for example WindowProc)
let wparam: i32;
let lparam: i32;
}

fn foo() {
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/similar_names.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ LL | let parsee: i32;
| ^^^^^^

error: binding's name is too similar to existing binding
--> $DIR/similar_names.rs:81:16
--> $DIR/similar_names.rs:85:16
|
LL | bpple: sprang,
| ^^^^^^
|
note: existing binding defined here
--> $DIR/similar_names.rs:80:16
--> $DIR/similar_names.rs:84:16
|
LL | apple: spring,
| ^^^^^^
Expand Down