Skip to content

Commit 66b7c68

Browse files
author
Raspreet Singh
committed
Update incorrect print output in std/box.md
All the print statements that output the size of a boxed object use the phrase "...occupies {} bytes on the stack", which is incorrect and should be changed to "...occupies {} bytes on the heap"
1 parent 37ba461 commit 66b7c68

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/std/box.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ fn main() {
6262
mem::size_of_val(&rectangle));
6363
6464
// box size == pointer size
65-
println!("Boxed point occupies {} bytes on the stack",
65+
println!("Boxed point occupies {} bytes on the heap",
6666
mem::size_of_val(&boxed_point));
67-
println!("Boxed rectangle occupies {} bytes on the stack",
67+
println!("Boxed rectangle occupies {} bytes on the heap",
6868
mem::size_of_val(&boxed_rectangle));
69-
println!("Boxed box occupies {} bytes on the stack",
69+
println!("Boxed box occupies {} bytes on the heap",
7070
mem::size_of_val(&box_in_a_box));
7171
7272
// Copy the data contained in `boxed_point` into `unboxed_point`

0 commit comments

Comments
 (0)