Skip to content

allow mutation of moved upvars #2152

Description

@nikomatsakis

Something like this should work:

fn foo() {
    let mut x = [mut ...];
    task::spawn(fn~[move x]() {
        x += [3];
    }):
}

Activity

  1. brson commented on Apr 9, 2012

    @brson
    Contributor

    Also when the move is done implicitly by last use? This seems right, but I can't recall ever running up against it.

  2. nikomatsakis commented on Apr 9, 2012

    @nikomatsakis
    ContributorAuthor

    I guess?

  3. graydon commented on May 30, 2013

    @graydon
    Contributor

    blocked on resolution of #6308

  4. nikomatsakis commented on Jun 6, 2013

    @nikomatsakis
    ContributorAuthor

    The syntax and particulars of this example do not relate,
    but it would still be useful to be able to have mutable upvars.
    Though if we remove copying closures it will not be relevant.

  5. emberian commented on Aug 5, 2013

    @emberian
    Contributor

    Visiting for triage; nothing to add

  6. catamorphism commented on Sep 26, 2013

    @catamorphism
    Contributor

    Obsolete given current plans for closures

  7. added a commit that references this issue on Sep 22, 2022
  8. added a commit that references this issue on Jul 8, 2026
  9. added a commit that references this issue on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-type-systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions