Skip to content

Segfault with | (or) and tuples and strs in match #6338

Closed
@Dretch

Description

@Dretch

The following code compiles:

fn main() {
    match ((1, ~"a"), (2, ~"b")) {
        ((1, a), (2, b)) |
        ((2, b), (1, a)) => {
            println(a);
            println(b);
        },
        _ => fail!(),
    }
}

But when it runs if fails like so (on 64 bit linux):

b
Segmentation fault (core dumped)

Note that it prints "b" before segfaulting, but that is actually incorrect - the first println should print "a".

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions