Skip to content

Commit 9352026

Browse files
Rollup merge of #127410 - trevyn:patch-1, r=compiler-errors
Correct description of E0502 Closes #126495
2 parents f664171 + 09b3fce commit 9352026

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)