The Rust team is happy to announce a new version of Rust, 1.53.0. Rust is a programming language that is empowering everyone to build reliable and eff

Announcing Rust 1.53.0 | Rust Blog

submited by
Style Pass
2021-06-17 15:00:05

The Rust team is happy to announce a new version of Rust, 1.53.0. Rust is a programming language that is empowering everyone to build reliable and efficient software.

If you don't have it already, you can get rustup from the appropriate page on our website, and check out the detailed release notes for 1.53.0 on GitHub.

This release contains several new language features and many new library features, including the long-awaited IntoIterator implementation for arrays. See the detailed release notes to learn about other changes not covered by this post.

This is the first Rust release in which arrays implement the IntoIterator trait. This means you can now iterate over arrays by value:

This was not implemented before, due to backwards compatibility problems. Because IntoIterator was already implemented for references to arrays, array.into_iter() already compiled in earlier versions, resolving to (&array).into_iter().

As of this release, arrays implement IntoIterator with a small workaround to avoid breaking code. The compiler will continue to resolve array.into_iter() to (&array).into_iter(), as if the trait implementation does not exist. This only applies to the .into_iter() method call syntax, and does not affect any other syntax such as for e in [1, 2, 3], iter.zip([1, 2, 3]) or IntoIterator::into_iter([1, 2, 3]), which all compile fine.

Leave a Comment