Progress toward a GCC-based Rust compiler
Progress toward a GCC-based Rust compiler
Posted Dec 19, 2023 16:36 UTC (Tue) by mathstuf (subscriber, #69389)In reply to: Progress toward a GCC-based Rust compiler by farnz
Parent article: Progress toward a GCC-based Rust compiler
Note that the borrow checker itself is not part of the language, but of the implementation. Rust's rule is "shared XOR mutable"; the borrow checker is an inexact implementation of an enforcement for this. It has been improved over time from the original lexical borrow checker to non-lexical lifetimes to polonius in the future. I presume that a runtime could also enforce it (at the cost of runtime overhead). In fact, I wonder if valgrind could be enhanced to verify this for any given program at runtimeā¦that would give any implementation more trust in its enforcement of the rule.