Skip to content

Incorrect result when using match on tuple with slice #16648

Description

@retep998

This causes bad to be output

fn main() {
    let x = (2i, &[1i, 2i]);
    match x {
        (0, [_, _]) => {},
        (1, _) => {},
        (2, [_, _]) => println!("good"),
        (2, _) => println!("bad"),
        _ => {},
    }
}

Deleting either (0, [_, _]) => {}, or (1, _) => {}, causes it to output good.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions