Announcing Rust 1.85.0 and Rust 2024 (blog.rust-lang.org)
from snaggen@programming.dev to rust@programming.dev on 20 Feb 17:20
https://programming.dev/post/25762568

#rust

threaded - newest

Rogue@feddit.uk on 20 Feb 23:18 collapse

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.

aljazmerzen@fosstodon.org on 21 Feb 13:29 next collapse

@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.

Rogue@feddit.uk on 21 Feb 13:40 collapse

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

thingsiplay@beehaw.org on 21 Feb 13:41 collapse

You can think of the Rust Editions as updates to the language, that would break compatibility with previous versions. But the key here is, that you can mix crates with older versions and the new one in one project and cargo will figure out which one to use for each crate (based on the cargo.toml file). That means breaking changes without breaking compatibility of existing libraries and crates, unlike in other languages.