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
We’re happy to announce the release of Rust 1.41.0, featuring relaxed restrictions for trait implementations, Cargo improvements, and many more changes! Check out the highlights in our blog post: https://t.co/jVINf2ESyL
— Rust Language (@rustlang) January 30, 2020
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 bothFrom
andVec
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
andVec
were foreign, the trait (in this caseFrom
) was parameterized by a local type. Therefore, Rust 1.41.0 allows thisimpl
.
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:
- Library changes include the following stabilized APIs: Result::map_or, Result::map_or_else, std::rc::Weak::weak_count, std::sync::Weak::weak_count, and std::sync::Weak::strong_count
MaybeUninit<T>
now implementsfmt::Debug
.- Support for the i686-unknown-dragonfly target has been removed.
- Users can now pass argument files passing the
@path
syntax to rustc.
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.
The post Rust 1.41.0 updates feature relaxed restrictions for trait implementations appeared first on JAXenter.
Source : JAXenter