3 ms·
Rice's theorem. That's an overly glib answer. The fully general form of this problem is undecidable, but it would be theoretically possible to build a "reverse
by ameliaquining 9y ago
Rice's theorem.
That's an overly glib answer. The fully general form of this problem is undecidable, but it would be theoretically possible to build a "reverse borrow checker" that analyzes a Rust program, detects raw pointers that are provably used exclusively in ways compatible with Rust's lifetime semantics, and converts them to references. But it would probably be a fairly major project requiring lots of specialized knowledge, because lifetime semantics are complicated. Nobody has attempted it yet as far as I know, although the author of Corrode has expressed interest.