Closed
Description
Location
Location is E0502.md, the explanation for Error code E0502
online version: https://doc.rust-lang.org/error_codes/E0502.html
Summary
The doc explains E0502 as follows:
A variable already borrowed as immutable was borrowed as mutable.
However, E0502 is also emitted when a variable already borrowed as mutable was borrowed as immutable. E.g. see line 1 and 13 in this file
1 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
...
13 error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
So it seems a more general explanation might be advisable that covers (at least) both types of cases.
Metadata
Metadata
Assignees
Labels
Area: The borrow checkerArea: Messages for errors, warnings, and lintsArea: Documentation for any part of the project, including the compiler, standard library, and toolsDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Relevant to the compiler team, which will review and decide on the PR/issue.