Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double bind in alt causes assert in trans #3038

Closed
jruderman opened this issue Jul 26, 2012 · 1 comment
Closed

Double bind in alt causes assert in trans #3038

jruderman opened this issue Jul 26, 2012 · 1 comment
Labels
A-typesystem Area: The type system
Milestone

Comments

@jruderman
Copy link
Contributor

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.

@catamorphism
Copy link
Contributor

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

@ghost ghost assigned catamorphism Jul 26, 2012
RalfJung pushed a commit to RalfJung/rust that referenced this issue Aug 31, 2023
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Updates dependencies to their latest versions after running `cargo
update`

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-typesystem Area: The type system
Projects
None yet
Development

No branches or pull requests

2 participants