3 ms·
This is correct. Ref structs and refs are also subject to similar[0] to Rust's lifetime analysis to prevent them from being ever invalidated and having use-afte
by neonsunset 2y ago
This is correct. Ref structs and refs are also subject to similar[0] to Rust's lifetime analysis to prevent them from being ever invalidated and having use-after-free (even if that free is essentially going out of scope or popping a stack frame).
I assume pjc50 specifically refers to the fact that `ref struct` gives a strong guarantee while a regular struct can be placed wherever.
[0]: https://em-tg.github.io/csborrow/ https://em-tg.github.io/csborrow/
- harrison_clarke 2y agoi think of it like having rust's rules, but you only get one (implicit) lifetime variable (that's probably wrong in some subtle ways)