Skip to content

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

Merged
merged 2 commits into from
Jan 27, 2017

Conversation

tomprince
Copy link
Member

I'm not sure if there that should be updated for this change.

@@ -14,7 +14,6 @@
#![allow(indexing_slicing, shadow_reuse, unknown_lints, missing_docs_in_private_items)]
#![allow(needless_lifetimes)]

#[macro_use]
Copy link
Member Author

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.

@tomprince
Copy link
Member Author

The build failure also occurs on master.

Copy link
Contributor

@oli-obk oli-obk left a 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,
Copy link
Contributor

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

@oli-obk oli-obk merged commit 34399d4 into rust-lang:master Jan 27, 2017
@oli-obk
Copy link
Contributor

oli-obk commented Jan 27, 2017

I'll publish a release, we can fix any exclusive pattern issues later (they are unstable anyway), at least clippy will compile again

@tomprince
Copy link
Member Author

I've pushed what I think is a fix for the false positive introduced here in #1479.

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 this pull request may close these issues.

2 participants