3 ms·
It has a new edition every year though :)
by nlitened 5y ago
It has a new edition every year though :)
- rapsey 5y agoNo it does not. 2015, 2018, 2021. With the 2021 changes so small few projects actually required any changes to be compatible from 2018.
- nindalf 5y agoThe 2021 changes could be applied with an autofix tool - “cargo fix --edition”. Most of these changes are small paper cuts that make sense to fix, but they’re breaking changes so they need to be opted into explicitly. For example, earlier use a field x of struct b in a closure would capture the ownership of the whole of b. In rust 2021, the closure will only take ownership of b.x. This makes sense, but it’s a breaking change and therefore it needs an opt-in. The Edition system is one of Rust’s biggest strengths IMO. Some languages never make breaking changes be enough if they’re small because it would break too much code. Other languages make breaking changes but expect users to migrate, placing a burden on them. The Rust edition system leaves it up to the user, on a per-crate (package) basis. Staying on the old edition is perfectly acceptable, as is moving to the new one. Further reading - https://doc.rust-lang.org/edition-guide/rust-2021/ https://doc.rust-lang.org/edition-guide/rust-2021/
- GolDDranks 5y ago*every three years, actually. The current one is 2021, the one before that was 2018 and the (implicit) first one 2015.