News

Polonius Alpha Lands on Nightly: Rust's Borrow Checker Gets Flow-Sensitive

The Rust team has enabled the next iteration of the borrow checker, Polonius Alpha, on nightly. It brings flow-sensitive analysis, accepting more code than NLL, with performance regressions mostly minor. Stabilization is targeted before year-end.

August 5, 2026· 2 min read
Polonius Alpha Lands on Nightly: Rust's Borrow Checker Gets Flow-Sensitive

The Rust borrow checker is getting its first major upgrade since NLL replaced the original AST-based checker. The team has enabled Polonius Alpha on nightly, a new formulation that brings flow-sensitive analysis to lifetime outlives relationships. This is the culmination of work that started in 2018, with a new approach imagined in 2023 that required minimal rearchitecture of the existing NLL implementation.

What Polonius Alpha unlocks

The key difference from NLL is that Polonius Alpha is flow-sensitive: it understands that a borrow isn't live in branches where it isn't used. NLL's analysis is flow-insensitive, which causes it to reject code that is actually sound.

The canonical example is a function that returns a mutable reference from a map, inserting a default value if the key is missing:

fn get_mut_or_default<'r, K: Hash + Eq + Copy, V: Default>(
    map: &'r mut HashMap<K, V>,
    key: K,
) -> &'r mut V {
    match map.get_mut(&key) {
        Some(value) => value,
        None => {
            map.insert(key, V::default());
            map.get_mut(&key).unwrap()
        }
    }
}

Under NLL, the Some(value) => value branch makes the borrow checker think the borrow from map.get_mut lives for the entire function, even though it's not live in the None branch. Polonius Alpha knows better.

Not perfect, but close

Polonius Alpha is not a superset of the original (slow) Polonius implementation. Some programs that compiled under legacy Polonius still don't compile with Alpha, and vice versa. The team acknowledges this and is calling it "Alpha" for a reason.

Performance is the main concern. Polonius Alpha does strictly equal or more work than NLL, and the team has been watching for regressions. In the top 10,000 crates by downloads, few significant regressions were found, and the worst case outside that set is a 2-3x slowdown on crates with many borrows. The team considers this acceptable given the added power.

Opting out and next steps

If you're on nightly and want to stick with NLL, you can pass -Zpolonius=off to rustc, set RUSTFLAGS=-Zpolonius=off, or use a .cargo/config.toml file:

[target.x86_64-unknown-linux-gnu]
rustflags = ["-Zpolonius=off"]

The team is asking for feedback on GitHub and Zulip to catch any unsoundness, performance regressions, or diagnostic issues before stabilization, which is targeted before the end of the year. After that, active feature work on Polonius will pause, with focus shifting to optimization and other priorities.

Polonius Alpha is flow-sensitive: it knows the borrow isn't live in the None branch, so the code compiles. NLL's analysis is flow-insensitive, so it rejects it.
Manul X Editorial
Borrow checker evolution
At a glance
CheckerFlow-sensitivityStatusNotes
AST borrowckNoRemoved 2019Very limited, phased out
NLLNoStable since 2019Current default, flow-insensitive
Polonius AlphaYesNightly (2026)Flow-sensitive, accepts more code, minor regressions
Legacy PoloniusYesNever stabilizedSlow, non-starter for performance
Polonius Alpha on Nightly: Rust's Borrow Checker Gets Flow-Sensitive | Manul X