3 ms·
The article mentions expanding capabilities to support self-referential structs. Currently structs are allowed to borrow from any data outside of them, but not
by pornel 3y ago
The article mentions expanding capabilities to support self-referential structs.
Currently structs are allowed to borrow from any data outside of them, but not from any of their own fields. Rust doesn't want to have move constructors, and borrowing from inline fields can't be safe, but borrowing from heap-allocated data owned by the same struct should be possible, and currently there's no non-hacky way to express that.
- cwzwarich 3y agoI was specifically referring to the ability to borrow a set of fields/paths. Enabling more useful self-referential structs would be something more novel.