Do values in return position always get allocated in the parents stack frame or receiving Box?
问题 I was trying to understand how structs behave when returned from methods. There is a section in the nightlies section of the "Rust Book" that said if you used the syntax... let x = box i_return_a_struct(); .. that there wouldn't be a copy, therefore there is no need to return a pointer. But when I started playing with it, it appears that the box is not needed, unless you need the value to exist on the heap. #[derive(Debug)] struct Dummy { data: i64, } impl Drop for Dummy { fn drop(&mut self)