Skip to content

Double bind in alt causes assert in trans #3038

Closed
@jruderman

Description

@jruderman

Example with a matching names in a single record:

fn main()
{
    let pt = {x: 1, y: 2};
    let _x = alt pt {
        {x, x} { x }
    };
}

Example with two records:

fn main()
{
    let pt = {x: 1, y: 2};
    let pt2 = {x: 1, y: 2};
    let _x = alt (pt, pt2) {
       ({x, y}, {x, y}) { x }
    };
}

Example with a tuple:

fn main()
{
    let _z = alt (1, 2) {
        (x, x) { x }
    };
}

All give me:

rust: task failed at 'Assertion cx.fcx.lllocals.contains_key(nid) failed', /Users/jruderman/code/rust/src/rustc/middle/trans/base.rs:2438

The Rust compiler should catch this before it gets to LLVM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions