Skip to content

Proc lifetime bug #11925

Closed
Closed
@bvssvni

Description

@bvssvni
fn main() {
    let r = {
        let x = 42;
        let f = proc() &x;
        f()
    };

    // Prints out '&1', but should give a compiler error 'borrowed value does not live long enough'.
    println!("{:?}", r);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lifetimesArea: Lifetimes / regionsA-type-systemArea: Type systemE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions