Skip to content

Commit

Permalink
Update incorrect print output in std/box.md
Browse files Browse the repository at this point in the history
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"
  • Loading branch information
Raspreet Singh committed Jul 3, 2022
1 parent 37ba461 commit 66b7c68
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/std/box.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ fn main() {
mem::size_of_val(&rectangle));
// box size == pointer size
println!("Boxed point occupies {} bytes on the stack",
println!("Boxed point occupies {} bytes on the heap",
mem::size_of_val(&boxed_point));
println!("Boxed rectangle occupies {} bytes on the stack",
println!("Boxed rectangle occupies {} bytes on the heap",
mem::size_of_val(&boxed_rectangle));
println!("Boxed box occupies {} bytes on the stack",
println!("Boxed box occupies {} bytes on the heap",
mem::size_of_val(&box_in_a_box));
// Copy the data contained in `boxed_point` into `unboxed_point`
Expand Down

0 comments on commit 66b7c68

Please sign in to comment.