Enabling the next iteration of the borrow checker on nightly
4 hours ago
- The Polonius Alpha borrow checker is being enabled on Rust nightly as a precursor to stabilization in the coming months.
- Polonius introduces flow-sensitive borrow checking, allowing more valid code to compile, such as code that conditionally returns borrows or uses match arms.
- NLL (Non-Lexical Lifetimes) is flow-insensitive实战 and can be too conservative in such cases.
- Performance regressions are generally minimal for most crates, but the worst case observed is a 2-3x slowdown for crates with many borrows.
- Users can opt-out via -Zpolonius=off or configuration files, but they are encouraged to report issues if needed.
- The goal is to stabilize Polonius Alpha by the end of the year, with ongoing work focused on performance, documentation, and addressing any reported issues.
- After stabilization, the team plans to shift focus to other priorities, but may revisit feature work later.