about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-02-14 03:59:09 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-02-14 05:06:33 +0530
commit1598995766cfd18360f05c2a282ff9f1eb9c73da (patch)
tree6ba74b505d77856e72a8854fc3df3ed888fbb637
parent302e5cb232049d73604e2a34c5f455a523de656c (diff)
parent8f61a4b34c40e67e302b1abd84fd59a1a452e1e6 (diff)
downloadrust-1598995766cfd18360f05c2a282ff9f1eb9c73da.tar.gz
rust-1598995766cfd18360f05c2a282ff9f1eb9c73da.zip
Rollup merge of #31563 - SDX2000:docfixes1, r=steveklabnik
This is a minor change. Please see title. IMO this is important since this is the first instance when we talk about allocating a vector. Not saying that it is allocated on the stack here leaves room for speculation and this might put off some people (they might not even read the later sections which go into more detail about this).
-rw-r--r--src/doc/book/ownership.md10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/doc/book/ownership.md b/src/doc/book/ownership.md
index a62d31d362b..175960f67b6 100644
--- a/src/doc/book/ownership.md
+++ b/src/doc/book/ownership.md
@@ -51,10 +51,11 @@ fn foo() {
 }
 ```
 
-When `v` comes into scope, a new [vector] is created, and it allocates space on
-[the heap][heap] for each of its elements. When `v` goes out of scope at the
-end of `foo()`, Rust will clean up everything related to the vector, even the
-heap-allocated memory. This happens deterministically, at the end of the scope.
+When `v` comes into scope, a new [vector] is created on [the stack][stack],
+and it allocates space on [the heap][heap] for its elements. When `v` goes out
+of scope at the end of `foo()`, Rust will clean up everything related to the
+vector, even the heap-allocated memory. This happens deterministically, at the
+end of the scope.
 
 We'll cover [vectors] in detail later in this chapter; we only use them
 here as an example of a type that allocates space on the heap at runtime. They
@@ -67,6 +68,7 @@ Vectors have a [generic type][generics] `Vec<T>`, so in this example `v` will ha
 [arrays]: primitive-types.html#arrays
 [vectors]: vectors.html
 [heap]: the-stack-and-the-heap.html
+[stack]: the-stack-and-the-heap.html#the-stack
 [bindings]: variable-bindings.html
 [generics]: generics.html