days
0
-35
-6
hours
-1
-1
minutes
-4
0
seconds
-3
-2
search
The latest additions

Rust 1.41.0 updates feature relaxed restrictions for trait implementations

Sarah Schlothauer
rust
© Shutterstock / ENTERfobaE_Studio

Let’s say hello to the newest version of Rust, take a peek at some of the new features introduced in version 1.41.0 stable, as well as a look forward to some of the events happening in 2020. This new update includes some improvements to Cargo, introduces relaxed restrictions for trait implementations, a new Cargo.lock format, some library changes, and a few more tweaks under the hood.

Welcome the latest version of Rust: Version 1.41.10 stable. This update contains a few small new additions, improvements and changes.

As usual, you can easily update to the latest version via rustup with:

$ rustup update stable

Let’s dive right into the new highlights and see what’s in store.

SEE ALSO: Java EE Guardians become Jakarta EE Ambassadors

Implementing traits change

Arguably, the biggest changes introduced in 1.41.0 are the newly relaxed restrictions when implementing traits. According to the announcement blog:

In Rust 1.40.0 this impl was forbidden by the orphan rule, as both From and Vec are defined in the standard library, which is foreign to the current crate. There were ways to work around the limitation, such as the newtype pattern, but they were often cumbersome or even impossible in some cases.

While it’s still true that both From and Vec were foreign, the trait (in this case From) was parameterized by a local type. Therefore, Rust 1.41.0 allows this impl.

See the original stabilization proposal for additional information.

Cargo changes

Rust’s package manager receives a few changes.

  • Cargo uses a file called Cargo.lock, which helps ensure consistent builds and checks dependency versions. This update adds an optimized git-friendly format which will help reduce potential merge conflicts. From now on, this file format will be used for all new lockfiles.
  • If cargo install detects that a package is out of date, it will now update and reinstall it. This is an improvement upon the old way, which required passing the --force flag and reinstalling all binary crates.
  • Users can override specific dependency’s build settings.

A note on future compatibility

Rust 1.41.0 will be the last tier 1 release for 32-bit Apple targets. From now on, new releases will be demoted down to tier 3. Tier 3 targets will not be available to download through rustup, but the source code will still be available to build.

Devs that build 32-bit Apple binaries should read the announcement about this reduced support and see how it will affect them.

SEE ALSO: Fantastic performance and where to find it

Misc. Rust 1.41.0 changes

Some other additions included in this update:

The full release notes are available on GitHub.

Meet up plans for 2020?

In addition to this new version, Rust also posted an event line up for 2020 detailing international Rust-related conferences and meetings. Events span across the globe, from Brussels to Berlin, and up from Quebec down to Mexico City.

See if any Rustaceans are meeting in your neck of the woods for hackfests or open source dev meetings.

Author
Sarah Schlothauer

Sarah Schlothauer

All Posts by Sarah Schlothauer

Sarah Schlothauer is an assistant editor for JAXenter.com. She received her Bachelor's degree from Monmouth University and is currently enrolled at Goethe University in Frankfurt, Germany where she is working on her Masters. She lives in Frankfurt with her husband and cat. She is also the editor for Conditio Humana, an online magazine about ethics, AI, and technology.

Leave a Reply

avatar
400