Rollup merge of #127410 - trevyn:patch-1, r=compiler-errors

Correct description of E0502

Closes #126495
This commit is contained in:
Michael Goulet 2024-07-06 14:55:24 -04:00 committed by GitHub
commit 9352026d26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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:
@ -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) {}