1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-08-08 16:26:35 +02:00

Add speaker note that arrays go on the stack (#2826)

This commit is contained in:
Nicole L
2025-07-23 10:37:19 -07:00
committed by GitHub
parent 4dbbcce4b8
commit 1a3c11b03e

View File

@ -65,4 +65,9 @@ fn main() {
- Adding `#`, eg `{a:#?}`, invokes a "pretty printing" format, which can be - Adding `#`, eg `{a:#?}`, invokes a "pretty printing" format, which can be
easier to read. easier to read.
- Arrays are not heap-allocated. They are regular values with a fixed size known
at compile time, meaning they go on the stack. This can be different from what
students expect if they come from a garbage collected language, where arrays
may be heap allocated by default.
</details> </details>