Correct description of E0502
This commit is contained in:
parent
51917e2e69
commit
09b3fcebf4
1 changed files with 3 additions and 2 deletions
|
@ -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:
|
Erroneous code example:
|
||||||
|
|
||||||
|
@ -13,7 +14,7 @@ fn foo(a: &mut i32) {
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix this error, ensure that you don't have any other references to the
|
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) {}
|
fn bar(x: &mut i32) {}
|
||||||
|
|
Loading…
Add table
Reference in a new issue