Skip to content

Add sugar to simplify mutable function arguments #3488

Closed
@erickt

Description

@erickt

While it's pretty easy to write a function that makes an argument mutable:

fn foo(x: ~int) {
    let x = move x;
    ...
}

It'd be nice to save a line here and there to add some sugar to express an argument is directly mutable, with something like:

fn foo(mut x: ~int) { ... }

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)C-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