The part about performance seems surprising to me. Sure, it's slower, but shouldn't the baseline be something like: first run the old borrow checker, and only run the new one if it finds a problem? Given that the checking is a function at a time, it seems like that shouldn't even slow down failing cases by all that much. Then you can optimize that by dividing traditional failures into "nope, that's just wrong" vs "might possibly pass Polonius".
Polonius Alpha accepts a superset of the programs that the old NLL one accepted, right?
Not the greatest for code maintenance, but it's hard to imagine this producing a "2-3x regression" (the worst case observed). And it's not something I"d recommend if it didn't sound like speed is the gating factor for releasing this.
(I doubt I'm the first to think of this, so there are probably Very Good Raisins behind the decision to not do this.)
Any new advancements regarding Rust borrow checking and allowing new code is always a very challenging exercise, as people have already accustomed to the "that style of code doesn't compile"-area of the current compiler, so the most battle hardened devs probably have a terribly challenging time of actually encountering the new, now allowed, type of code.
So cool that the mut_or_default now actually correctly borrow checks. I'll be watching for cool new patterns that this'll allow in the future!
The part about performance seems surprising to me. Sure, it's slower, but shouldn't the baseline be something like: first run the old borrow checker, and only run the new one if it finds a problem? Given that the checking is a function at a time, it seems like that shouldn't even slow down failing cases by all that much. Then you can optimize that by dividing traditional failures into "nope, that's just wrong" vs "might possibly pass Polonius".
Polonius Alpha accepts a superset of the programs that the old NLL one accepted, right?
Not the greatest for code maintenance, but it's hard to imagine this producing a "2-3x regression" (the worst case observed). And it's not something I"d recommend if it didn't sound like speed is the gating factor for releasing this.
(I doubt I'm the first to think of this, so there are probably Very Good Raisins behind the decision to not do this.)
Any new advancements regarding Rust borrow checking and allowing new code is always a very challenging exercise, as people have already accustomed to the "that style of code doesn't compile"-area of the current compiler, so the most battle hardened devs probably have a terribly challenging time of actually encountering the new, now allowed, type of code.
So cool that the mut_or_default now actually correctly borrow checks. I'll be watching for cool new patterns that this'll allow in the future!