about summary refs log tree commit diff
path: root/src/liballoc_system
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-07-27 11:02:27 +0000
committerbors <bors@rust-lang.org>2018-07-27 11:02:27 +0000
commit6998b369faf3daf849f538d636bac9eda659fa5a (patch)
tree7e5d936229061e5ed7d2f33c8277e13961eba1be /src/liballoc_system
parentb18b9edf006c10f4e08794d31425001401e27a09 (diff)
parent946264526ca0c4c89233410623f231a385e3be71 (diff)
downloadrust-6998b369faf3daf849f538d636bac9eda659fa5a.tar.gz
rust-6998b369faf3daf849f538d636bac9eda659fa5a.zip
Auto merge of #52733 - pnkfelix:issue-51348-make-temp-for-each-candidate-in-arm, r=nikomatsakis
[NLL] make temp for each candidate in `match` arm

In NLL, `ref mut` patterns leverage the two-phase borrow infrastructure to allow the shared borrows within a guard before the "activation" of the mutable borrow when we begin execution of the match arm's body. (There is further discussion of this on PR #50783.)

To accommodate the restrictions we impose on two-phase borrows (namely that there is a one-to-one mapping between each activation and the original initialization), this PR is making separate temps for each candidate pattern. So in an arm like this:
```rust
PatA(_, ref mut ident) |
PatB(ref mut ident) |
PatC(_, _, ref mut ident) |
PatD(ref mut ident) if guard_stuff(ident) => ...
```

instead of 3 temps (two for the guard and one for the arm body), we now have 4 + 2 temps associated with `ident`: one for each candidate plus the actual temp that the guard uses directly, and then the sixth is the temp used in the arm body.

Fix #51348
Diffstat (limited to 'src/liballoc_system')
0 files changed, 0 insertions, 0 deletions