Skip to content

ICE with ref pattern on integers #33499

@Manishearth

Description

@Manishearth
fn main() {
    let x = (0,2);
    match x {
        (0, ref y) => { /* use y */}
        (y, 0) => { /* use y */ }
        _ => ()
    }
}

playpen

This causes an ICE at error: internal compiler error: ../src/librustc_trans/_match.rs:944: only string and byte strings supported in compare_values on stable, beta, and nightly.

It goes away if you swap the match arms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions