Skip to content

Compiler lets escape borrowed pointer to local variable. #8229

Closed
@dim-an

Description

@dim-an

Following code can be successfully compiled using rust-0.7 and from master.

fn foo<'a>(a: &'a int) -> &'a Option<int> {
    let v: &'a Option<int> = &None;
    v
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.E-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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions