Skip to content
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

match miscompiled with range and wildcard #31373

Closed
durka opened this issue Feb 2, 2016 · 1 comment
Closed

match miscompiled with range and wildcard #31373

durka opened this issue Feb 2, 2016 · 1 comment

Comments

@durka
Copy link
Contributor

durka commented Feb 2, 2016

This may be the same bug as #18060. This code

fn main() {
    // ok
    match (1, 0) {
        (0, 0...1) |
        (1, 0...0) => Ok(()),
        _ => Err(())
    }.unwrap();

    // error
    match (1, 0) {
        (0, 0...1) |           // <-- endpoint of first range must be greater than that of the second one
        (1, 0...0) => Ok(()),
        (_, _) => Err(())      // <-- must be a tuple of _
    }.unwrap();
}

gets the second match wrong somehow, under very specific circumstances. Minified from user "bellows" in #rust-beginners.

@Mark-Simulacrum
Copy link
Member

This compiles and runs successfully. Presumably, that's what this issue wanted, though it wasn't very clear. Closing.

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

No branches or pull requests

2 participants