Skip to content

two-phase borrows creates extra error messages #48418

Closed
@nikomatsakis

Description

@nikomatsakis

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-NLLArea: Non-lexical lifetimes (NLL)A-diagnosticsArea: Messages for errors, warnings, and lintsNLL-diagnosticsWorking towards the "diagnostic parity" goalT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions