Oct. 11th, Thursday - 10:00 - 10:30
The first six years in the development of Polonius, an improved borrow checker
When the current borrow checker, non-lexical lifetimes (NLL), was developed, one of the patterns the Rust developers wanted to add support for had to be abandoned: Case 3, in which a reference is conditionally returned early from a function. This case is particularly tricky to support as it requires a high-resolution analysis of the conditional flow references beyond the means of the current borrow checker. Therefore, current Rust does not support this code pattern (and others like it), even though it is provably safe.
Since 2018, work has been ongoing to extend the borrow checker to support this case in the Polonius project. An early prototype implemented in Datalog is available in nightly Rust under an experimental flag. However, its performance and scaling properties make it insufficient for stabilisation. The working group is aiming to ship a prototype of Polonius with acceptable performance characteristics for the Rust 2024 edition, this time without Datalog.
This talk presents a history of the work on Polonius, explains how it differs from the current borrow checker, and describes the path to stabilisation and beyond.