Tree Borrows is a new framework that enhances the Rust programming language's ownership-based type system by replacing the stack in Stacked Borrows with a tree structure. This change reduces the rejection of valid test cases by 54% and enables additional optimizations, including read-read reorderings, while maintaining most benefits of the original Stacked Borrows. The work was recognized with a Distinguished Paper Award at PLDI'25.
Rust's borrowchecker, while designed to enforce memory safety by managing ownership rules, often creates significant ergonomic challenges for developers. These challenges arise from its strict compile-time requirements and inability to accurately reason about certain code patterns, leading to frustrating compilation errors that can impede development. The article argues that the borrowchecker's role in ensuring safety is overstated and highlights cases where it unnecessarily rejects valid code.