Skip to content

closures: No explanation of &: #405

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
kornelski opened this issue Jan 13, 2015 · 2 comments
Closed

closures: No explanation of &: #405

kornelski opened this issue Jan 13, 2015 · 2 comments

Comments

@kornelski
Copy link
Contributor

The closure syntax uses a mysterious sigil &: which isn't explained.

@strega-nil
Copy link

&: means a closure by reference, i.e. the variables that are closed over are passed by reference.
&mut: is the same, but they're now mutable.
move means that all variables are actually moved into the closure.

More reading here.

@mdinger
Copy link
Contributor

mdinger commented Feb 12, 2015

That sigil is gone now: rust-lang/rust#21843

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants