Closed
Description
As uncovered in #47689, two-phase borrows as implemented can lead to "extra" and confusing error messages. The problem is that each time we have a "gen " of the activation, we do the activation check -- but if there are two activations in a row, each of them can emit an error, when we only want an error from the first.
The HEAD~1
commit in branch issue-48418
on my repository fixes the problem, but probably not in a sound way, as discussed in this commit (and its successor).
The proper fix either involves adding a dominator check (suppress activation of bit B at A2 if it is dominated by another activation of bit B at A1), or else a "must activate" sort of analysis.
cc @pnkfelix