Skip to content

Warn about overlapping match arm #471

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
antoyo opened this issue Nov 24, 2015 · 0 comments · Fixed by #520
Closed

Warn about overlapping match arm #471

antoyo opened this issue Nov 24, 2015 · 0 comments · Fixed by #520
Labels
A-lint Area: New lints good first issue These issues are a good way to get started with Clippy T-AST Type: Requires working with the AST

Comments

@antoyo
Copy link

antoyo commented Nov 24, 2015

Hello.
It would be nice to have a warning for the following code:

let x = 5;
match x {
    1 ... 10 => println!("1 ... 10"),
    5 ... 15 => println!("5 ... 15"),
    _ => (),
}

because the first two match arms are overlapping.

Thanks.

@Manishearth Manishearth added good first issue These issues are a good way to get started with Clippy T-AST Type: Requires working with the AST A-lint Area: New lints labels Nov 25, 2015
mcarton added a commit to mcarton/rust-clippy that referenced this issue Dec 23, 2015
mcarton added a commit to mcarton/rust-clippy that referenced this issue Dec 23, 2015
mcarton added a commit to mcarton/rust-clippy that referenced this issue Dec 23, 2015
@mcarton mcarton mentioned this issue Dec 23, 2015
llogiq added a commit that referenced this issue Jan 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints good first issue These issues are a good way to get started with Clippy T-AST Type: Requires working with the AST
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants