4 ms·
This is good info, but I don't fully understand why pinning makes self-references safe. I thought the problem with self-references was that they interfere with
by brundolf 5y ago
This is good info, but I don't fully understand why pinning makes self-references safe. I thought the problem with self-references was that they interfere with single-ownership, which is required for automatic deallocation?
I guess maybe if direct self-referencing is a distinct case from indirect self-referencing then it might not be problematic for single-ownership?
- deleted 5y ago[deleted]
- pixel_fcker 5y agoThe problem with self-references is that if you move the containing struct then the reference is now invalid. Pinning the object so it can’t move works around this.
- antonin42 5y agoI don’t know enough about Rust I always think about passing these self referencing structure by reference in other languages.