Skip to content

Add sugar to simplify mutable function arguments #3488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
erickt opened this issue Sep 13, 2012 · 8 comments
Closed

Add sugar to simplify mutable function arguments #3488

erickt opened this issue Sep 13, 2012 · 8 comments
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@erickt
Copy link
Contributor

erickt commented Sep 13, 2012

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) { ... }
@nikomatsakis
Copy link
Contributor

+1

@bstrie
Copy link
Contributor

bstrie commented Sep 13, 2012

I've stubbed my toe on this as well.

@nikomatsakis
Copy link
Contributor

I started tagging some of the places in the code where this would be useful with FIXME(#3488)

@Dretch
Copy link
Contributor

Dretch commented Nov 12, 2012

+1

@sanxiyn
Copy link
Member

sanxiyn commented Jan 3, 2013

I am working on this.

@sanxiyn sanxiyn mentioned this issue Jan 4, 2013
@catamorphism
Copy link
Contributor

Fixed: 54344c2

@sanxiyn
Copy link
Member

sanxiyn commented Jan 23, 2013

Can places with FIXME be fixed, or does that require a snapshot?

@catamorphism
Copy link
Contributor

@sanxiyn Yes, that will require a snapshot, because it has to be possible to compile the libraries with the stage0 compiler (the existing snapshot). But we are going to make a snapshot soon.

sanxiyn added a commit to sanxiyn/rust that referenced this issue Jan 31, 2013
brson added a commit that referenced this issue Feb 1, 2013
bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
RalfJung pushed a commit to RalfJung/rust that referenced this issue Apr 20, 2024
os_str: comment clarification and typo fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

6 participants