Closed
Description
Book 2018-edition is amazing.
Yet in ch15-02-deref.md#using-boxt-like-a-reference, the first sentence
(The only difference between Listing 15-7 and Listing 15-6 is that here we set y to be an instance of a box pointing to the value in x rather than a reference pointing to the value of x.)
seems a bit misleading.
Box::new allocates memory on the heap and then places x
into it while x is on stack. The instance of box is pointing to a value in a newly allocated heap memory, not in x.
Thanks.