-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Regression in match patterns in beta #57894
Labels
P-high
High priority
regression-from-stable-to-beta
Performance or correctness regression from stable to beta.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Reduced: fn main() {
assert_eq!(false, match -50_i8 { -128i8...-101i8 => true, _ => false, });
}
// also with if-let:
fn main() {
assert_eq!(false, if let -128i8...-101i8 = -50_i8 { true } else { false });
} cc @varkor |
Introduced between
Commits between those nightlies - indeed looks like #56695 is suspicious |
#56695 does look like the culprit. I'll try to fix this tomorrow. Thanks @jonas-schievink! |
triage: P-high. Assigned to @varkor |
bors
added a commit
that referenced
this issue
Feb 1, 2019
…oli-obk Fix bug in integer range matching Fixes #57894.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
P-high
High priority
regression-from-stable-to-beta
Performance or correctness regression from stable to beta.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Hello, the pattern matching in match arms seems to have different behavior in stable than in beta/nightly.
I tried this code:
I expected to see this happen: In all chains, it should print "OK".
Instead, this happened: It prints "OK" in stable, but it prints "out of bounds, -50" in beta/nightly.
Example in the playground
I understand that this code is not very idiomatic, but still, I think that the behavior should be consistent between Rust versions.
The text was updated successfully, but these errors were encountered: