about summary refs log tree commit diff
path: root/src/librustdoc/html/static/main.js
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-05-22 01:32:42 +0000
committerbors <bors@rust-lang.org>2020-05-22 01:32:42 +0000
commit458a3e76294fd859fb037f425404180c91e14767 (patch)
tree58dbb752d8ca9a64c3fe9362bd92dfdba89c0183 /src/librustdoc/html/static/main.js
parentd9417b385145af1cabd0be8a95c65075d2fc30ff (diff)
parent3ff93177cf7976c1db072cdcb4bc3f23e5f6b78c (diff)
downloadrust-458a3e76294fd859fb037f425404180c91e14767.tar.gz
rust-458a3e76294fd859fb037f425404180c91e14767.zip
Auto merge of #71956 - ecstatic-morse:remove-requires-storage-analysis, r=tmandry
Clean up logic around live locals in generator analysis

Resolves #69902. Requires #71893.

I've found it difficult to make changes in the logic around live locals in `generator/transform.rs`. It uses a custom dataflow analysis, `MaybeRequiresStorage`, that AFAICT computes whether a local is either initialized or borrowed. That analysis is using `before` effects, which we should try to avoid if possible because they are harder to reason about than ones only using the unprefixed effects. @pnkfelix has suggested removing "before" effects entirely to simplify the dataflow framework, which I might pursue someday.

This PR replaces `MaybeRequiresStorage` with a combination of the existing `MaybeBorrowedLocals` and a new `MaybeInitializedLocals`. `MaybeInitializedLocals` is just `MaybeInitializedPlaces` with a coarser resolution: it works on whole locals instead of move paths. As a result, I was able to simplify the logic in `compute_storage_conflicts` and `locals_live_across_suspend_points`.

This is not exactly equivalent to the old logic; some generators are now smaller than before. I believe this was because the old logic was too conservative, but I'm not as familiar with the constraints as the original implementers were, so I could be wrong. For example, I don't see a reason the size of the `mixed_sizes` future couldn't be 5K. It went from 7K to 6K in this PR.

r? @jonas-schievink @tmandry
Diffstat (limited to 'src/librustdoc/html/static/main.js')
0 files changed, 0 insertions, 0 deletions