diff options
| author | bors <bors@rust-lang.org> | 2014-10-17 02:07:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-17 02:07:24 +0000 |
| commit | 3dec727297e6ebd6614219a93f376d8181ab11b1 (patch) | |
| tree | 3b32606a720eb3baa059837b0f0c4068cc8f54ee /src/rustllvm/RustWrapper.cpp | |
| parent | 1600e0b93c4edf10bce71fbb68d383827c40a153 (diff) | |
| parent | fdd69accd0c9366b882a0e0d93ddb94eee307431 (diff) | |
| download | rust-3dec727297e6ebd6614219a93f376d8181ab11b1.tar.gz rust-3dec727297e6ebd6614219a93f376d8181ab11b1.zip | |
auto merge of #17869 : bkoropoff/rust/bound-all-the-upvars, r=nikomatsakis
This PR is based on #17784, which fixes closure soundness problems in borrowck. Only the last two commits are unique to this PR. My understanding of regionck is still evolving, so I'm not sure if this is the right approach. Feedback is appreciated. - In `link_reborrowed_region`, we account for the ability of upvars to change their mutability due to later processing. A map of recursive region links we may want to establish in the future is maintained, with the links being established when the mutability of the borrow is adjusted. - When asked to establish a region link for an upvar, we link it to the region of the closure body. This creates the necessary constraint to stop unsound reborrows from the closure environment. This partially (maybe completely) solves issue #17403. Remaining work: - This is only known to help with by-ref upvars. I have not looked at by-value upvars yet to see if they can cause problems. - The error diagnostics that result from failed region inference are pretty inscrutible.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
