Skip to content

Commit

Permalink
Rollup merge of #127410 - trevyn:patch-1, r=compiler-errors
Browse files Browse the repository at this point in the history
Correct description of E0502

Closes #126495
  • Loading branch information
compiler-errors authored Jul 6, 2024
2 parents f664171 + 09b3fce commit 9352026
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 9352026

Please sign in to comment.