New ownership guide#17138
Conversation
|
I also only deprecated the old one 😉 ❤️ @huonw |
|
Yay! I'll read through the whole thing when I get time. Couple of things:
|
|
@Manishearth move semantics aren't exactly the same thing as ownership. |
|
Hm, agreed, but I found them closely related. While learning Rust at first I didn't realize the difference between move/copy values and thus confused myself a lot. It took me a while to consolidate |
Ownership implies move semantics, and values moving are one of the major ways people hit ownership... they're intimately linked. (e.g. taking a |
24f0d34 to
941ca29
Compare
There was a problem hiding this comment.
That sounds like what lives in the heap is a Box<int>. But that's not true. In your case x living on the stack would be a Box<int>, a handle you can use to reach the heap-allocated int.
This is the start of the new "Ownership" guide, to replace the lifetimes guide.
I'm still working on it, but I wanted to share my progress, as this guide is very important, and I'd like as many eyes on it as possible. 😄