Skip to content

False positive in match blocks for shadow #319

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

Closed
Manishearth opened this issue Sep 8, 2015 · 0 comments · Fixed by #321
Closed

False positive in match blocks for shadow #319

Manishearth opened this issue Sep 8, 2015 · 0 comments · Fixed by #321

Comments

@Manishearth
Copy link
Member

match (1,1,2) {
(a,b,2) | (2,a,b) => (),
_=>()
}

There's no shadowing here.

test.rs:7:14: 7:15 warning: a is shadowed by 1 [-W shadow-unrelated]
test.rs:7 (a,b,2) | (2,a,b) => (),
                       ^
test.rs:6:10: 6:11 note: initialization happens here
test.rs:6 match (1,1,2) {
                   ^
test.rs:7:14: 7:15 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#shadow_unrelated
test.rs:7:16: 7:17 warning: b is shadowed by 2 [-W shadow-unrelated]
test.rs:7 (a,b,2) | (2,a,b) => (),
                         ^
test.rs:6:12: 6:13 note: initialization happens here
test.rs:6 match (1,1,2) {
                     ^
test.rs:7:16: 7:17 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#shadow_unrelated

Fixing #318 would make it easier to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant