Skip to content

Anonymous function with upvar trips assert in trans #1467

Closed
@jruderman

Description

@jruderman
fn main() {
    let x = 3;
    (fn() {
        assert x == 3;
    })();
}

Result:

rust: upcall fail 'Assertion cx.fcx.llupvars.contains_key(did.node) failed', ../src/comp/middle/trans.rs:2688
rust: domain main @0x7fe932819a00 root task failed

Expected?

error: attempted dynamic environment-capture

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions