Move lifetime diagnostics after consume operator diagnostics.

This fixes bugs when ~Escapable types depended on values that are passed to 'consume'.

The consume operator diagnostics are broken when dependent values are
present. This sidesteps the problem for lifetime dependence. And we
generally want to diagnose lifetime dependence after all move-only
related diagnostics. That way, using a dependent value after consume
provides a more informative diagnostic about the dependent value and
its scope.
This commit is contained in:
Andrew Trick
2024-03-24 16:57:04 -07:00
parent f81f7f9c54
commit 6b776f57fb
2 changed files with 15 additions and 7 deletions

View File

@@ -155,6 +155,8 @@ bool CheckerLivenessInfo::compute() {
}
}
}
// FIXME: this ignores all other forms of Borrow ownership, such as
// partial_apply [onstack] and mark_dependence [nonescaping].
break;
}
case OperandOwnership::GuaranteedForwarding: