Edition and Version: Thoughts and Request for Feedback

โš“ Rust    ๐Ÿ“… 2025-07-17    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 2      

surdeus

Iโ€™d like to check whether this understanding is sound, and whether there are any other important aspects worth knowing.


In the reference for cargo.toml / manifest there is the distinction between Version and Edition that I overlooked as a newcomer. Reading the individual descriptions for version, and edition didn't fully clarify the distinction for me.

However, I found the forum discussion, which I'd summarise as follows:

  1. Rust Edition: Introduces breaking changes in the language โ€”that is, non backward-compatible changes.
  2. Rust version: Introduces non-breaking changes and language features โ€”backward-compatible changes.

An example of a breaking change (Edition) is given in The Rust Editions Guide where they explain how async would have broken code like let async = 1. So it's a change included in an edition. Code using lower editions can't use that functionality.

Code that isn't breaking, like the recent let chains would not be a breaking change.

Hence, projects using edition 2015 can use version 1.88 and let else chains.

I initially wrote this as a question about "Why not to use the major slot in rust-version to include such breaking changes?" But the answer is: the rust-version allows for any edition to use the non-breaking changes. Using a single version identifier would block some projects from using those non breaking changes.

Another interesting bit in the guide cited above is that neither version nor edition changes are ecosystem-breaking; any crate can use any version / edition combination without issues.

1 post - 1 participant

Read full topic

๐Ÿท๏ธ rust_feed