Skip to content

Allows moving in owned values into multiple closures #7444

Closed
@bluss

Description

@bluss

The following testcase crashes at runtime when call_f is called the second time. It appears rustc accepts to move the value t into "both" heap closures.

fn call_f(f: ~fn:Owned() -> int) -> int {
    f()
}

fn main() {
    let t = ~3;

    call_f(|| { *t + 1 });
    call_f(|| { *t + 1 });
}

Tested with version f1e09d6 / rustc 0.6 (f1e09d6 2013-06-26 23:07:41 -0700)

Assign to @bblum

Metadata

Metadata

Assignees

Labels

I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions