Skip to content

Compiler ICE: alt branch with non-unanimous binding site #2932

Closed
@efaust

Description

@efaust

The following code ICE's the compiler built from the 0.3 tarball:

enum whatever {
    OneWay,
    SameWay(int),
    OtherWay
}

fn getWhatever() -> whatever {
    SameWay(7)
}

fn main()
{
    let what = getWhatever();
    alt what{
        OneWay | SameWay(foo) { io::println("oooh"); }
        OtherWay { io::println("aaaaaahhhh"); }
    };  
}

The problem is that not all of the subcases produce the same binding site in the first branch of the alt. This seems to be related to issue #2869. Looks like this just be made a compilation error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions