mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Rollup merge of #25963 - steveklabnik:link_to_cell, r=alexcrichton
This commit is contained in:
commit
f90aecff76
@ -159,7 +159,7 @@ b.x = 10; // error: cannot assign to immutable field `b.x`
|
||||
|
||||
[struct]: structs.html
|
||||
|
||||
However, by using `Cell<T>`, you can emulate field-level mutability:
|
||||
However, by using [`Cell<T>`][cell], you can emulate field-level mutability:
|
||||
|
||||
```rust
|
||||
use std::cell::Cell;
|
||||
@ -176,4 +176,6 @@ point.y.set(7);
|
||||
println!("y: {:?}", point.y);
|
||||
```
|
||||
|
||||
[cell]: ../std/cell/struct.Cell.html
|
||||
|
||||
This will print `y: Cell { value: 7 }`. We’ve successfully updated `y`.
|
||||
|
Loading…
Reference in New Issue
Block a user