4 ms·
You may find this paper interesting: GhostCell: Separating Permissions from Data in Rust <https://plv.mpi-sws.org/rustbelt/ghostcell/paper.pdf https://plv.mpi-
by nybble41 5y ago
You may find this paper interesting:
GhostCell: Separating Permissions from Data in Rust
<https://plv.mpi-sws.org/rustbelt/ghostcell/paper.pdf https://plv.mpi-sws.org/rustbelt/ghostcell/paper.pdf>
The essential idea is that you can use one of these "GhostCell" structures to assign a lifetime to a related collection of objects (such as the nodes in a graph), which allows the entire graph to be treated as if it had a single owner and a single lifetime rather than a separate owner and lifetime per node.
The paper is relatively recent (2021), and GhostCell is not, so far as I am aware, used in rustc at this point.