Skip to content

Commit b150a42

Browse files
committed
---
yaml --- r: 136631 b: refs/heads/dist-snap c: fdd511d h: refs/heads/master i: 136629: 0544f27 136627: 61a1595 136623: d85ed6e v: v3
1 parent 8af6f3a commit b150a42

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 189b7332968972f34cdbbbd9b62d97ababf53059
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 72c27aba9ca429d7c0a1741a8b63bbc1c8050faf
9+
refs/heads/dist-snap: fdd511d124523707b20227a7497aced1540add7e
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/doc/reference.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3950,16 +3950,16 @@ to each function as the task executes. A stack allocation is reclaimed when
39503950
control leaves the frame containing it.
39513951

39523952
The _heap_ is a general term that describes two separate sets of boxes: managed
3953-
boxes — which may be subject to garbage collection — and owned
3954-
boxes. The lifetime of an allocation in the heap depends on the lifetime of
3955-
the box values pointing to it. Since box values may themselves be passed in and
3956-
out of frames, or stored in the heap, heap allocations may outlive the frame
3957-
they are allocated within.
3953+
boxes — which may be subject to garbage collection — and boxes. The
3954+
lifetime of an allocation in the heap depends on the lifetime of the box values
3955+
pointing to it. Since box values may themselves be passed in and out of frames,
3956+
or stored in the heap, heap allocations may outlive the frame they are
3957+
allocated within.
39583958

39593959
### Memory ownership
39603960

39613961
A task owns all memory it can *safely* reach through local variables, as well
3962-
as managed, owned boxes and references.
3962+
as managed, boxes and references.
39633963

39643964
When a task sends a value that has the `Send` trait to another task, it loses
39653965
ownership of the value sent and can no longer refer to it. This is statically
@@ -4013,23 +4013,22 @@ state. Subsequent statements within a function may or may not initialize the
40134013
local variables. Local variables can be used only after they have been
40144014
initialized; this is enforced by the compiler.
40154015

4016-
### Owned boxes
4016+
### Boxes
40174017

4018-
An _owned box_ is a reference to a heap allocation holding another value,
4019-
which is constructed by the prefix operator `box`. When the standard library is
4020-
in use, the type of an owned box is `std::owned::Box<T>`.
4018+
An _box_ is a reference to a heap allocation holding another value, which is
4019+
constructed by the prefix operator `box`. When the standard library is in use,
4020+
the type of an box is `std::owned::Box<T>`.
40214021

4022-
An example of an owned box type and value:
4022+
An example of an box type and value:
40234023

40244024
```
40254025
let x: Box<int> = box 10;
40264026
```
40274027

4028-
Owned box values exist in 1:1 correspondence with their heap allocation,
4029-
copying an owned box value makes a shallow copy of the pointer. Rust will
4030-
consider a shallow copy of an owned box to move ownership of the value. After a
4031-
value has been moved, the source location cannot be used unless it is
4032-
reinitialized.
4028+
Box values exist in 1:1 correspondence with their heap allocation, copying an
4029+
box value makes a shallow copy of the pointer. Rust will consider a shallow
4030+
copy of an box to move ownership of the value. After a value has been moved,
4031+
the source location cannot be used unless it is reinitialized.
40334032

40344033
```
40354034
let x: Box<int> = box 10;

0 commit comments

Comments
 (0)