Skip to content

Add one-shot closures #2549

Closed
Closed
@eholk

Description

@eholk

It's currently really hard to use noncopyable data with things like vec::each or uint::range, since the type system doesn't know how many times these functions will invoke their closures. It'd be nice to have some way for the compiler to know that a closure will be called at most once, so it can be safe to move out of upvars in these closures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions