-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
document for E0502 insufficiently general #126495
Copy link
Copy link
Closed
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsD-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.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.
Description
Metadata
Metadata
Assignees
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsD-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.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.
Location
Location is E0502.md, the explanation for Error code E0502
https://github.com/rust-lang/rust/blob/master/compiler/rustc_error_codes/src/error_codes/E0502.md
online version: https://doc.rust-lang.org/error_codes/E0502.html
Summary
The doc explains E0502 as follows:
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
So it seems a more general explanation might be advisable that covers (at least) both types of cases.