Skip to content

Commit

Permalink
fix #1628: the box pointer is on stack not on heap (#1629)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhicodes-crypto authored Oct 21, 2022
1 parent 47a386d commit 03491f3
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 heap",
println!("Boxed point occupies {} bytes on the stack",
mem::size_of_val(&boxed_point));
println!("Boxed rectangle occupies {} bytes on the heap",
println!("Boxed rectangle occupies {} bytes on the stack",
mem::size_of_val(&boxed_rectangle));
println!("Boxed box occupies {} bytes on the heap",
println!("Boxed box occupies {} bytes on the stack",
mem::size_of_val(&box_in_a_box));
// Copy the data contained in `boxed_point` into `unboxed_point`
Expand Down

0 comments on commit 03491f3

Please sign in to comment.