Implement destructuring assignment for structs and slices#78836
Merged
bors merged 1 commit intorust-lang:masterfrom Nov 13, 2020
Merged
Implement destructuring assignment for structs and slices#78836bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
7 tasks
0396638 to
e562723
Compare
petrochenkov
reviewed
Nov 7, 2020
petrochenkov
reviewed
Nov 8, 2020
petrochenkov
reviewed
Nov 9, 2020
Contributor
|
Also, #78748 has been merged, so this can be rebased. (Some GitHub tools like marking files as reviewed don't really work on individual commits, only on whole PRs, so reviewing PRs based on other PRs is harder.) |
fa3f32f to
547603f
Compare
Contributor
|
r=me after addressing #78836 (comment), updating failing UI tests and squashing commits. |
Contributor
Author
|
Great! I'll squash as soon as CI passes. |
Co-authored-by: varkor <github@varkor.com>
9c976a5 to
de84ad9
Compare
Contributor
Author
|
Just squashed, should be ready for approval. |
Contributor
|
@bors r+ |
Collaborator
|
📌 Commit de84ad9 has been approved by |
This was referenced Nov 11, 2020
Collaborator
|
⌛ Testing commit de84ad9 with merge 9ecbbfae550c6d172d4ea7c9306f0c7c7db0f7d2... |
Collaborator
|
💔 Test failed - checks-actions |
Member
Member
|
Not much I can do, sorry. See https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/pinging.20for.20zlib.20error for what's going on. |
Member
|
@bors retry |
m-ou-se
added a commit
to m-ou-se/rust
that referenced
this pull request
Nov 12, 2020
…ing, r=petrochenkov Implement destructuring assignment for structs and slices This is the second step towards implementing destructuring assignment (RFC: rust-lang/rfcs#2909, tracking issue: rust-lang#71126). This PR is the second part of rust-lang#71156, which was split up to allow for easier review. Note that the first PR (rust-lang#78748) is not merged yet, so it is included as the first commit in this one. I thought this would allow the review to start earlier because I have some time this weekend to respond to reviews. If `@petrochenkov` prefers to wait until the first PR is merged, I totally understand, of course. This PR implements destructuring assignment for (tuple) structs and slices. In order to do this, the following *parser change* was necessary: struct expressions are not required to have a base expression, i.e. `Struct { a: 1, .. }` becomes legal (in order to act like a struct pattern). Unfortunately, this PR slightly regresses the diagnostics implemented in rust-lang#77283. However, it is only a missing help message in `src/test/ui/issues/issue-77218.rs`. Other instances of this diagnostic are not affected. Since I don't exactly understand how this help message works and how to fix it yet, I was hoping it's OK to regress this temporarily and fix it in a follow-up PR. Thanks to `@varkor` who helped with the implementation, particularly around the struct rest changes. r? `@petrochenkov`
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 12, 2020
Rollup of 7 pull requests Successful merges: - rust-lang#76730 (Fix rustdoc rendering of by-value mutable arguments in async fn) - rust-lang#78836 (Implement destructuring assignment for structs and slices) - rust-lang#78857 (Improve BinaryHeap performance) - rust-lang#78950 (Add asm register information for SPIR-V) - rust-lang#78970 (update rustfmt to v1.4.25) - rust-lang#78972 (Update cargo) - rust-lang#78987 (extend min_const_generics param ty tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This was referenced Nov 13, 2020
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Nov 20, 2020
…ing, r=petrochenkov Implement destructuring assignment for structs and slices This is the second step towards implementing destructuring assignment (RFC: rust-lang/rfcs#2909, tracking issue: rust-lang#71126). This PR is the second part of rust-lang#71156, which was split up to allow for easier review. Note that the first PR (rust-lang#78748) is not merged yet, so it is included as the first commit in this one. I thought this would allow the review to start earlier because I have some time this weekend to respond to reviews. If ``@petrochenkov`` prefers to wait until the first PR is merged, I totally understand, of course. This PR implements destructuring assignment for (tuple) structs and slices. In order to do this, the following *parser change* was necessary: struct expressions are not required to have a base expression, i.e. `Struct { a: 1, .. }` becomes legal (in order to act like a struct pattern). Unfortunately, this PR slightly regresses the diagnostics implemented in rust-lang#77283. However, it is only a missing help message in `src/test/ui/issues/issue-77218.rs`. Other instances of this diagnostic are not affected. Since I don't exactly understand how this help message works and how to fix it yet, I was hoping it's OK to regress this temporarily and fix it in a follow-up PR. Thanks to ``@varkor`` who helped with the implementation, particularly around the struct rest changes. r? ``@petrochenkov``
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.
This is the second step towards implementing destructuring assignment (RFC: rust-lang/rfcs#2909, tracking issue: #71126). This PR is the second part of #71156, which was split up to allow for easier review.
Note that the first PR (#78748) is not merged yet, so it is included as the first commit in this one. I thought this would allow the review to start earlier because I have some time this weekend to respond to reviews. If @petrochenkov prefers to wait until the first PR is merged, I totally understand, of course.
This PR implements destructuring assignment for (tuple) structs and slices. In order to do this, the following parser change was necessary: struct expressions are not required to have a base expression, i.e.
Struct { a: 1, .. }becomes legal (in order to act like a struct pattern).Unfortunately, this PR slightly regresses the diagnostics implemented in #77283. However, it is only a missing help message in
src/test/ui/issues/issue-77218.rs. Other instances of this diagnostic are not affected. Since I don't exactly understand how this help message works and how to fix it yet, I was hoping it's OK to regress this temporarily and fix it in a follow-up PR.Thanks to @varkor who helped with the implementation, particularly around the struct rest changes.
r? @petrochenkov