Skip to content

False positive in match blocks for shadow #319

Closed
@Manishearth

Description

@Manishearth
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions