diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2020-11-12 19:46:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-12 19:46:09 +0100 |
| commit | 3a648ffc02823ad7ba20188876663ed25903f1b5 (patch) | |
| tree | a03d5f1d908e39e676ae8ad95429a417d34779fb /compiler/rustc_mir/src/transform/coverage/debug.rs | |
| parent | 92ece848735c51767b95d31055e57405dec511e5 (diff) | |
| parent | 5f310d9b83b172c0b6ba36e6878a5e5e6254de02 (diff) | |
| download | rust-3a648ffc02823ad7ba20188876663ed25903f1b5.tar.gz rust-3a648ffc02823ad7ba20188876663ed25903f1b5.zip | |
Rollup merge of #78836 - fanzier:struct-and-slice-destructuring, 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: #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``
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/debug.rs')
0 files changed, 0 insertions, 0 deletions
