From 1b301ee85c07d426711576de266203cabcaaf247 Mon Sep 17 00:00:00 2001 From: Abhishek Marrivagu Date: Fri, 21 Oct 2022 13:10:34 +0530 Subject: [PATCH] fix #1628: the box pointer is on stack not on heap --- src/std/box.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/std/box.md b/src/std/box.md index 0740c07d66..ebc8ff430a 100644 --- a/src/std/box.md +++ b/src/std/box.md @@ -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`