Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions compiler/rustc_error_codes/src/error_codes/E0502.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
A variable already borrowed as immutable was borrowed as mutable.
A variable already borrowed with a certain mutability (either mutable or
immutable) was borrowed again with a different mutability.

Erroneous code example:

Expand All @@ -13,7 +14,7 @@ fn foo(a: &mut i32) {
```

To fix this error, ensure that you don't have any other references to the
variable before trying to access it mutably:
variable before trying to access it with a different mutability:

```
fn bar(x: &mut i32) {}
Expand Down