diff options
| author | Jakub Bukaj <jakub@jakub.cc> | 2014-11-19 22:41:24 +0100 |
|---|---|---|
| committer | Jakub Bukaj <jakub@jakub.cc> | 2014-11-19 22:41:24 +0100 |
| commit | 1b8ee82b5433f3e53dac7186b74439e1b4bbc786 (patch) | |
| tree | 994270891a86ab1c762cf51810d4617f39f11a83 | |
| parent | f71b852d3865e878b953cb280724fb2ce1203103 (diff) | |
| parent | ebe812f0c637968b298edb8109d39002277ec4fd (diff) | |
| download | rust-1b8ee82b5433f3e53dac7186b74439e1b4bbc786.tar.gz rust-1b8ee82b5433f3e53dac7186b74439e1b4bbc786.zip | |
rollup merge of #19107: cakebaker/change_an_box_to_a_box
| -rw-r--r-- | src/doc/reference.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md index 5e8018f81c6..d21d877c458 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -4039,19 +4039,19 @@ initialized; this is enforced by the compiler. ### Boxes -An _box_ is a reference to a heap allocation holding another value, which is +A _box_ is a reference to a heap allocation holding another value, which is constructed by the prefix operator `box`. When the standard library is in use, -the type of an box is `std::owned::Box<T>`. +the type of a box is `std::owned::Box<T>`. -An example of an box type and value: +An example of a box type and value: ``` let x: Box<int> = box 10; ``` -Box values exist in 1:1 correspondence with their heap allocation, copying an +Box values exist in 1:1 correspondence with their heap allocation, copying a box value makes a shallow copy of the pointer. Rust will consider a shallow -copy of an box to move ownership of the value. After a value has been moved, +copy of a box to move ownership of the value. After a value has been moved, the source location cannot be used unless it is reinitialized. ``` |
