Allow ref and mut modifiers for short form field patterns - #10833
Merged
Conversation
Contributor
|
Could the test include |
Member
|
This is amazing! I've always wanted this. If you expand the test coverage I'd r+. In addition to what @huonw mentioned, it'd be nice to see some coverage of making sure that 'ref mut' requires the binding to mutable, 'ref' doesn't move, things like that. |
Contributor
|
Also, probably worth checking multiple fields |
Member
Author
|
Will do |
Contributor
|
Since this is a change to the language we should probably discuss it in a meeting. |
Contributor
|
+1 |
Previously, if you wanted to bind a field mutably or by ref, you had to
do something like Foo { x: ref mut x }. You can now just do
Foo { ref mut x }.
Closes rust-lang#6137
bors
added a commit
that referenced
this pull request
Dec 11, 2013
Previously, if you wanted to bind a field mutably or by ref, you had to
do something like Foo { x: ref mut x }. You can now just do
Foo { ref mut x }.
Closes #6137
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, if you wanted to bind a field mutably or by ref, you had to
do something like Foo { x: ref mut x }. You can now just do
Foo { ref mut x }.
Closes #6137