4 ms·
> it's encouraging to me that Rust's semantics allow borrow checking to keep getting better without breaking changes Just to be clear, these are breaking chang
by cwzwarich 4y ago
> it's encouraging to me that Rust's semantics allow borrow checking to keep getting better without breaking changes
Just to be clear, these are breaking changes. If the new borrow checker didn’t break existing code, they would have removed the old one long ago. They’ve just decided that the observable effects of the breaking change in the ecosystem are small enough (especially after warning about them for years) that they are okay making the breaking change without a semver-incrementing Rust 2.0.
To be fair, the reason for the breaking changes is generally to fix soundness issues (of course, not every example of code now banned will exhibit unsoundness), but that doesn’t cover all of them. There were some completely sound (albeit useless) examples of partial initialization that broke with NLL:
https://github.com/rust-lang/rust/issues/21232#issuecomment-427152371 https://github.com/rust-lang/rust/issues/21232#issuecomment-...
https://github.com/rust-lang/rust/issues/54987 https://github.com/rust-lang/rust/issues/54987
Strict adherence to semver would require still accepting this code.
- brundolf 4y agoSure, I guess all I meant was that the fundamental semantics of borrowing and lifetimes that were chosen at the beginning have continued to scale up to a better and better borrow-checker experience. They haven't found deep limitations of the language that prevented innovation without going back to the drawing board.