Skip to content

Commit 6d2e3d4

Browse files
committed
Note that Vec<T> is heap allocated.
Fixes #20948
1 parent cf636c2 commit 6d2e3d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/doc/trpl/arrays-vectors-and-slices.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ languages.
4949

5050
A *vector* is a dynamic or "growable" array, implemented as the standard
5151
library type [`Vec<T>`](../std/vec/) (we'll talk about what the `<T>` means
52-
later). Vectors are to arrays what `String` is to `&str`. You can create them
53-
with the `vec!` macro:
52+
later). Vectors always allocate their data on the heap. Vectors are to slices
53+
what `String` is to `&str`. You can create them with the `vec!` macro:
5454

5555
```{rust}
5656
let v = vec![1, 2, 3]; // v: Vec<i32>

0 commit comments

Comments
 (0)