Skip to content

Commit 09b3fce

Browse files
authored
Correct description of E0502
1 parent 51917e2 commit 09b3fce

File tree

1 file changed

+3
-2
lines changed
  • compiler/rustc_error_codes/src/error_codes

1 file changed

+3
-2
lines changed

compiler/rustc_error_codes/src/error_codes/E0502.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
A variable already borrowed as immutable was borrowed as mutable.
1+
A variable already borrowed with a certain mutability (either mutable or
2+
immutable) was borrowed again with a different mutability.
23

34
Erroneous code example:
45

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

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

1819
```
1920
fn bar(x: &mut i32) {}

0 commit comments

Comments
 (0)