-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Borrow checker gives confusing error message when in loop #10876
Copy link
Copy link
Closed
Labels
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
When the borrow check fails in a loop, the error message can be quite confusing:
The borrow checker informs me:
This message is confusing, because the two occurrences have the same line number and column. In fact, the error message is right: the borrow check only fails because it is being performed in a loop. The error message should mention something like that to the effect.