Skip to content

A proc can be called twice when captured in a proc #12127

Closed
@huonw

Description

@huonw
fn main() {
    let a = ~"foo";
    let f = proc() { println!("{}", a); drop(a) };
    (proc() {
        f();
        f();
    })()
}

understandably crashes on the second f call.

Seems similar to #12041 (although no loop required), and #10398.

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