about summary refs log tree commit diff
path: root/src/test/rustdoc-js-std/enum-option.js
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-02-25 06:27:35 +0000
committerbors <bors@rust-lang.org>2019-02-25 06:27:35 +0000
commit31eb0e2d3c0bfd2e0f5b662d82971c1a203708be (patch)
treed54f740779bf1dcdc1d499831dca0aa4e649f504 /src/test/rustdoc-js-std/enum-option.js
parentc1911babed0364ede7dedc646dbca63fac03d5c5 (diff)
parent5ffc9197264a07a50bfb27e436fe284ae8c0687c (diff)
downloadrust-31eb0e2d3c0bfd2e0f5b662d82971c1a203708be.tar.gz
rust-31eb0e2d3c0bfd2e0f5b662d82971c1a203708be.zip
Auto merge of #57609 - matthewjasper:more-restrictive-match, r=pnkfelix
Use normal mutable borrows in matches

`ref mut` borrows are currently two-phase with NLL enabled. This changes them to be proper mutable borrows. To accommodate this, first the position of fake borrows is changed:

```text
[ 1. Pre-match ]
       |
[ (old create fake borrows) ]
[ 2. Discriminant testing -- check discriminants ] <-+
       |                                             |
       | (once a specific arm is chosen)             |
       |                                             |
[ (old read fake borrows) ]                          |
[ 3. Create "guard bindings" for arm ]               |
[ (create fake borrows) ]                            |
       |                                             |
[ 4. Execute guard code ]                            |
[ (read fake borrows) ] --(guard is false)-----------+
       |
       | (guard results in true)
       |
[ 5. Create real bindings and execute arm ]
       |
[ Exit match ]
```

The following additional changes are made to accommodate `ref mut` bindings:

* We no longer create fake `Shared` borrows. These borrows are no longer needed for soundness, just to avoid some arguably strange cases.
* `Shallow` borrows no longer conflict with existing borrows, avoiding conflicting access between the guard borrow access and the `ref mut` borrow.

There is some further clean up done in this PR:

* Avoid the "later used here" note for Shallow borrows (since it's not relevant with the message provided)
* Make any use of a two-phase borrow activate it.
* Simplify the cleanup_post_borrowck passes into a single pass.

cc #56254

r? @nikomatsakis
Diffstat (limited to 'src/test/rustdoc-js-std/enum-option.js')
0 files changed, 0 insertions, 0 deletions