Skip to content

ICE: unreachable code in check_static.rs is actually reachable. #18118

@pnkfelix

Description

@pnkfelix

There is an ICE from the check_static pass, due to a match that has a bunch of cases that lead to unreachable!. I think this particular case is the mc::cat_local.

here is the test case (this code is meant to be rejected, but not ICE):

pub fn main() {
    static x : int = 3i;
    let y = {
        static z: Box<&'static int> = {
            let p = x;
            let a = &p;
            box a
        };
        z
    };
}

playpen link

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions