Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix borrow checker unsoundness with unions #47689
@pnkfelix so I think the problem was that whenever we saw a Gen bit for an activation, we treated that as an activation that needs checking. I think that should only be required for loans that are not already activated. I made that change in the most recent commit. Can you review it?
referenced this pull request
Feb 21, 2018
So it seems like what we need is some way to know when one activation is dominated by another (in which case it can be ignored). Because activations are "unioned" on control-flow join, we don't get that for free. Annoying. We could make a "must be activated" dataflow, but it feels like overkill to me.
That said, this seems orthogonal from the original PR. Why don't we do this -- I'll peel off my last two commits and we'll open up a separate issue to discuss the extra errors resulting from two-phase borrows. Then we can land this PR, which fixes a legit problem.