Skip to content

Commit 1b301ee

Browse files
fix rust-lang#1628: the box pointer is on stack not on heap
1 parent 47a386d commit 1b301ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/std/box.md

+3-3
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 heap",
65+
println!("Boxed point occupies {} bytes on the stack",
6666
mem::size_of_val(&boxed_point));
67-
println!("Boxed rectangle occupies {} bytes on the heap",
67+
println!("Boxed rectangle occupies {} bytes on the stack",
6868
mem::size_of_val(&boxed_rectangle));
69-
println!("Boxed box occupies {} bytes on the heap",
69+
println!("Boxed box occupies {} bytes on the stack",
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)