Third edition of the Rust programming language tees up a number of small changes expected to significantly improve the developer experience. Credit: cortixxx Rust 2021, the planned third edition of the Rust programming language due in October, is expected to significantly improve how Rust feels in practice, resulting from a number of small changes. In a May 11 bulletin, the Rust 2021 edition working group cited changes including a new prelude to the standard library, which is the module containing everything automatically imported in every module. The new prelude will fix an issue in which adding a trait can subtly break code. This will be done with three additions: std::convert::TryInto std::convert::TryFrom std::iter::FromIterator Also in Rust 2021, the new feature resolver introduced in Rust 1.51 in March will become the default. This resolver no longer merges all requested features for crates that are depended on in multiple ways. Other changes in the works for Rust 2021: Closures, anonymous functions that can automatically capture anything referred to from within their body, will only capture the fields they use. This resolves a programming issue involving the availability of structs. The panic! () macro will be more consistent, no longer accepting arbitrary expressions as the only argument. To make space for new syntax in the future, syntax will be reserved for prefixed identifiers and literals, including prefix#identifier, prefix”string”, prefix’c’, and prefix#123, where prefix can be any identifier. Future prefixes might include f”” as a shorthand for a format string, and c”” or z”” for null-terminated C strings. Another possibility is k”keyword, to allow writing keywords that do not exist yet. Two existing lints, bare-trait-objects and ellipsis-inclusive-range-patterns, will become hard errors in Rust 2021. Plans call for Rust 2021 Edition changes to make it into Rust 1.56.0, due in October. Editions of Rust serve as a mechanism to enable the release of features that would otherwise be backward incompatible, such as adding a keyword that would invalidate variables of the same name. Rust editions are opt-in, so existing crates do not see the changes until they explicitly migrate over to the new edition. Crates compiled in one edition will seamlessly interoperate with crates compiled in other editions. The working group seeks to make it easy to upgrade crates to a new edition. Related content analysis Beyond the usual suspects: 5 fresh data science tools to try today The mid-month report includes quick tips for easier Python installation, a new VS Code-like IDE just for Python and R users, and five newer data science tools you won't want to miss. By Serdar Yegulalp Jul 12, 2024 2 mins Python Programming Languages Software Development analysis Generative AI won’t fix cloud migration You’ve probably heard how generative AI will solve all cloud migration problems. It’s not that simple. Generative AI could actually make it harder and more costly. By David Linthicum Jul 12, 2024 5 mins Generative AI Artificial Intelligence Cloud Computing news HR professionals trust AI recommendations HireVue survey finds 73% of HR professionals trust AI to make candidate recommendations, while 75% of workers are opposed to AI making hiring decisions. By Paul Krill Jul 11, 2024 3 mins Technology Industry Careers how-to Safety off: Programming in Rust with `unsafe` What does it mean to write unsafe code in Rust, and what can you do (and not do) with the 'unsafe' keyword? The facts may surprise you. By Serdar Yegulalp Jul 11, 2024 8 mins Rust Programming Languages Software Development Resources Videos