-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix #1476: Add support for exclusive pattern matches. #1477
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
Fix #1476: Add support for exclusive pattern matches. #1477
Conversation
@@ -14,7 +14,6 @@ | |||
#![allow(indexing_slicing, shadow_reuse, unknown_lints, missing_docs_in_private_items)] | |||
#![allow(needless_lifetimes)] | |||
|
|||
#[macro_use] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unrelated but is causing test failures.
The build failure also occurs on master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the easiest would probably be to add a few tests to ensure that the lints in matches.rs
still work
@@ -361,7 +361,7 @@ fn all_ranges(cx: &LateContext, arms: &[Arm]) -> Vec<SpannedRange<ConstVal>> { | |||
} | |||
.filter_map(|pat| { | |||
if_let_chain! {[ | |||
let PatKind::Range(ref lhs, ref rhs) = pat.node, | |||
let PatKind::Range(ref lhs, ref rhs, _) = pat.node, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's quite right. The SpannedRange
returned below is different depending on the inclusiveness
I'll publish a release, we can fix any exclusive pattern issues later (they are unstable anyway), at least clippy will compile again |
I've pushed what I think is a fix for the false positive introduced here in #1479. |
I'm not sure if there that should be updated for this change.