Enabling the next iteration of the borrow checker on nightly

2 months ago by steam_lover to c/rust

Empowering everyone to build reliable and efficient software.
BB_C 9 points 2 months ago

The first thing these articles must mention is in which nightly SPECIFICALLY will the switch be made. Because it didn't happen yet with the latest nightly, and (the PR that will flip the switch is not even merged yet ):

-Zpolonius=off

error: incorrect value `off` for unstable option `polonius` - either no value or `legacy` (the default), or `next` was expected

Also

NLL's analysis is flow-insensitive.

Polonius Alpha passes this because its analysis is flow-sensitive

Always ask two+ people to proof-read your announcements before hitting publish.

path: 0 25128847, hotness: undefined, score: 9, children: 0
thingsiplay 2 points 2 months ago

I thought Polonius will be only implemented in a new version of Rust and tied to versions (from there all upwards off course). But it looks like this is independent from the Rust version? Does that mean everyone from older Rust versions will also benefit from it?

path: 0 25127912, hotness: undefined, score: 2, children: 3
BB_C 6 points 2 months ago

Did you mean editions?

path: 0 25127912 25128689, hotness: undefined, score: 6, children: 2
thingsiplay 3 points 2 months ago

Yes, I was thinking off editions, not the actual versions of Rust itself.

path: 0 25127912 25128689 25128738, hotness: undefined, score: 3, children: 1
BB_C 4 points 2 months ago

Well, if you try the reborrow example from the article with edition=2015 and RUSTFLAGS='-Zpolonius=next', you will see that it does indeed work. So the answer is yes.

path: 0 25127912 25128689 25128738 25128930, hotness: undefined, score: 4, children: 0
rust
rust

@lemmy.ml

login for more options
9402
397
129

go to feed...