Unhelpful "constants cannot evaluate destructors" with loops #72907
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
This code:
yields the following error:
That is not very helpful as there is nothing with a destructor on that line. The actual line where something could get dropped is line 11, and that is also the line where the drop-requiring thing is assigned into
always_returned
.Cc @rust-lang/wg-const-eval
The text was updated successfully, but these errors were encountered: