3 ms·
It's nice, but I suspect more an educational tool than a working programmer's tool. Rustc has good lifetime diagnostics, so it's not that huge a problem. What
by Animats 5y ago
It's nice, but I suspect more an educational tool than a working programmer's tool. Rustc has good lifetime diagnostics, so it's not that huge a problem.
What I'd like to see is something that does static analysis for reference-counted items. To access a reference-counted item, you often have to call .borrow(), which checks to see if someone else already has it borrowed. This panics on a conflict. That's a good problem for static analysis - is the .borrow() always safe, always going to fail, or unknown? Much of the time, it's always safe and could be optimized out.
- muizelaar 5y agoHow do you imagine this working? What are the scenarios where you want shared ownership but can prove that there's only one owner?
- zozbot234 5y ago> What I'd like to see is something that does static analysis for reference-counted items. This ought to be doable with GhostCell and similar efforts. https://plv.mpi-sws.org/rustbelt/ghostcell/ https://plv.mpi-sws.org/rustbelt/ghostcell/ It doesn't cover the entire spectrum of "borrow safety proofs" but it can be used to address simple cases.