Skip to content

Commit 047e1c3

Browse files
committed
---
yaml --- r: 275004 b: refs/heads/stable c: a6fedc8 h: refs/heads/master
1 parent 4598fb0 commit 047e1c3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: a8fd1bbd2f9511e9394fed1112c4ada186eb1b00
32+
refs/heads/stable: a6fedc85bfec568a404c4a78d9c7faef12937695
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/doc/book/ownership.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ on the [heap][sh] for the actual data (`[1, 2, 3]`). Rust copies the address
148148
of this heap allocation to an internal pointer, which is part of the vector
149149
object placed on the stack (let's call it the data pointer).
150150

151-
It is worth pointing out (even at the risk of repeating things) that the vector
152-
object and its data live in separate memory regions instead of being a single
153-
contiguous memory allocation (due to reasons we will not go into at this point
154-
of time). These two parts of the vector (the one on the stack and one on the
155-
heap) must agree with each other at all times with regards to things like the
156-
length, capacity etc.
151+
It is worth pointing out (even at the risk of stating the obvious) that the
152+
vector object and its data live in separate memory regions instead of being a
153+
single contiguous memory allocation (due to reasons we will not go into at
154+
this point of time). These two parts of the vector (the one on the stack and
155+
one on the heap) must agree with each other at all times with regards to
156+
things like the length, capacity etc.
157157

158158
When we move `v` to `v2`, rust actually does a bitwise copy of the vector
159159
object `v` into the stack allocation represented by `v2`. This shallow copy
@@ -169,7 +169,7 @@ For example if we truncated the vector to just two elements through `v2`:
169169
v2.truncate(2);
170170
```
171171

172-
and `v1` were still accessible we'd end up with an invalid vector since it
172+
and `v1` were still accessible we'd end up with an invalid vector since `v1`
173173
would not know that the heap data has been truncated. Now, the part of the
174174
vector `v1` on the stack does not agree with the corresponding part on the
175175
heap. `v1` still thinks there are three elements in the vector and will

0 commit comments

Comments
 (0)