Skip to content

Borrowck doesn't consider calls to fn~ to be borrows #2978

Closed
@nikomatsakis

Description

@nikomatsakis
Contributor

This program should fail:

fn call(x: @{mut f: fn~()}) {
    x.f(); //~ ERROR foo
    //~^ NOTE bar
}

fn main() {}

the reason is that it would be possible for the closure to cause itself to be freed. well, of course it's not actually possible in this case but it'd require alias analysis to know that.

Activity

added a commit that references this issue on Nov 6, 2012
87b8938

11 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-lifetimesArea: Lifetimes / regions

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @nikomatsakis

      Issue actions

        Borrowck doesn't consider calls to fn~ to be borrows · Issue #2978 · rust-lang/rust