two-phase borrows creates extra error messages #48418
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-NLL
Area: Non-lexical lifetimes (NLL)
NLL-diagnostics
Working towards the "diagnostic parity" goal
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone
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 branchissue-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
The text was updated successfully, but these errors were encountered: