mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-27 14:24:08 +00:00
Rollup merge of #28207 - tshepang:flow, r=steveklabnik
This commit is contained in:
commit
a10e87648f
@ -18,9 +18,9 @@ Before proceeding, it is highly recommended that one reads about [ownership][own
|
||||
|
||||
## `Box<T>`
|
||||
|
||||
[`Box<T>`][box] is pointer which is “owned”, or a “box”. While it can hand
|
||||
out references to the contained data, it is the only owner of the data. In particular, when
|
||||
something like the following occurs:
|
||||
[`Box<T>`][box] is an “owned” pointer, or a “box”. While it can hand
|
||||
out references to the contained data, it is the only owner of the data. In particular, consider
|
||||
the following:
|
||||
|
||||
```rust
|
||||
let x = Box::new(1);
|
||||
@ -40,7 +40,7 @@ allowed to share references to this by the regular borrowing rules, checked at c
|
||||
|
||||
[box]: ../std/boxed/struct.Box.html
|
||||
|
||||
## `&T` and `&mut T`
|
||||
## `&T` and `&mut T`
|
||||
|
||||
These are immutable and mutable references respectively. They follow the “read-write lock”
|
||||
pattern, such that one may either have only one mutable reference to some data, or any number of
|
||||
|
Loading…
Reference in New Issue
Block a user