auto merge of #16614 : cdwort/rust/pointer-guide-typo, r=steveklabnik
This appears to be a minor typo. This example implies that x is mutable otherwise the compiler would error on the line before the comment implies. Please let me know if I'm missing something - I'd love to learn what I got wrong!
This commit is contained in:
commit
b8e9bbf793
@ -332,7 +332,7 @@ let z = &x;
|
|||||||
Mutable ones, however, are not:
|
Mutable ones, however, are not:
|
||||||
|
|
||||||
```{rust,ignore}
|
```{rust,ignore}
|
||||||
let x = 5i;
|
let mut x = 5i;
|
||||||
let y = &mut x;
|
let y = &mut x;
|
||||||
let z = &mut x; // error: cannot borrow `x` as mutable more than once at a time
|
let z = &mut x; // error: cannot borrow `x` as mutable more than once at a time
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user