Skip to content

Double bind in alt causes assert in trans #3038

Closed

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.

Activity

  1. catamorphism commented on Jul 26, 2012

    @catamorphism
    Contributor

    Ooh, fun times. I'll look at it.

  2. added a commit that references this issue on Aug 31, 2023
  3. added a commit that references this issue on Aug 21, 2026
  4. added a commit that references this issue on Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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