For anyone like me who hasn’t seen an edition change before, it’s just a mechanism for bundling breaking changes together and making them opt-in.
We are excited to announce that the Rust 2024 Edition is now stable! Editions are a mechanism for opt-in changes that may otherwise pose a backwards compatibility risk.
@Rogue@snaggen Yeah, it’s a setting in Cargo.toml that you have to update manually if you want to upgrade. It is set to latest edition in new projects. And the nice thing:
it’s configurable per-crate, not per-compilation. So you can depend on crates that use different editions than your crate. Which avoids ecosystem fragmentation.
it’s configurable per-crate, not per-compilation. So you can depend on crates that use different editions than your crate. Which avoids ecosystem fragmentation.
Thanks! That pre-empted my next question of how quickly crates typically update to newer editions. I guess it doesn’t matter
There is also cargo fix --edition which can update your code in a very conservative way automatically. The result might not be as idiomatic but errs on the side of having semantics that do not change.
For anyone like me who hasn’t seen an edition change before, it’s just a mechanism for bundling breaking changes together and making them opt-in.
@Rogue @snaggen Yeah, it’s a setting in Cargo.toml that you have to update manually if you want to upgrade. It is set to latest edition in new projects. And the nice thing:
it’s configurable per-crate, not per-compilation. So you can depend on crates that use different editions than your crate. Which avoids ecosystem fragmentation.
Thanks! That pre-empted my next question of how quickly crates typically update to newer editions. I guess it doesn’t matter
There is also
cargo fix --edition
which can update your code in a very conservative way automatically. The result might not be as idiomatic but errs on the side of having semantics that do not change.