Skip to content

Commit 687d7f4

Browse files
committed
---
yaml --- r: 275005 b: refs/heads/stable c: 37a952a h: refs/heads/master i: 275003: 4598fb0
1 parent 047e1c3 commit 687d7f4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
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: a6fedc85bfec568a404c4a78d9c7faef12937695
32+
refs/heads/stable: 37a952a672ca79bfcc41795e378a710c196a557a
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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ Rust’s safety guarantees by introducing a data race if one could access both
166166
For example if we truncated the vector to just two elements through `v2`:
167167

168168
```rust
169+
# let v = vec![1, 2, 3];
170+
# let v2 = v;
169171
v2.truncate(2);
170172
```
171173

@@ -174,7 +176,9 @@ would not know that the heap data has been truncated. Now, the part of the
174176
vector `v1` on the stack does not agree with the corresponding part on the
175177
heap. `v1` still thinks there are three elements in the vector and will
176178
happily let us access the non existent element `v1[2]` but as you might
177-
already know this is a recipe for disaster (might lead to a segfault).
179+
already know this is a recipe for disaster. Especially because it might lead
180+
to a segmentation fault or worse allow an unauthorized user to read from
181+
memory to which they don't have access.
178182

179183
This is why Rust forbids using `v` after we’ve done the move.
180184

0 commit comments

Comments
 (0)