File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -171,10 +171,10 @@ v2.truncate(2);
171
171
172
172
and ` v1 ` were still accessible we'd end up with an invalid vector since it
173
173
would not know that the heap data has been truncated. Now, the part of the
174
- vector ` v1 ` on the stack does not agree with its corresponding part on the
174
+ vector ` v1 ` on the stack does not agree with the corresponding part on the
175
175
heap. ` v1 ` still thinks there are three elements in the vector and will
176
176
happily let us access the non existent element ` v1[2] ` but as you might
177
- already know this is a recipe for disaster.
177
+ already know this is a recipe for disaster (might lead to a segfault) .
178
178
179
179
This is why Rust forbids using ` v ` after we’ve done the move.
180
180
You can’t perform that action at this time.
0 commit comments