Rust 1.36.0 update: Cargo –offline support for Cargo and new stabilizations
2019 has been a big here for the programming language Rust; it polled for the fourth year in a row as the most loved language by developers on StackOverflow. The newest update to the language is v1.36.0. This release includes several changes: the stabilization of the Future trait, the alloc crate, offline support in Cargo, and more.
Rust-lang version 1.36.0 arrived on July 4, 2019. This new stable release adds some brand new features, stabilizations, library changes, and more.
Without further ado, let’s take at the changelog for some of the newest features and language changes.
Rust v1.35.0 features
Here are some of the highlights that this update makes to the language:
Futuretrait: Future, an asynchronous computation value, now is fully stable.
- Function changs:
MaybeUninit<T>now instead of
HashMap‘s implementation replaced with
alloccrate stabilized: With the new release, parts of the standard library are now available in the
alloccrate. The announcement blog suggests that library maintainers that depend upon allocation primitives to function should “consider making your library
- Language change: Order of the traits in trait objects does not affect object semantics. View the pull request for additional information.
- Non-Lexical Lifetimes (NLL) enabled for everyone: This change takes place in the 2015 version of Rust, in order to keep up with the 2018 version. View the pull request. For more information about what NLL is, and how it solves some issues and bugs, view this explanation blog about NLL in Rust.
- String implements From<&String>
dbg!macro now supports multiple arguments
- Various stabilized APIs: Including
- Fixes made to Clippy: View the changelog to the current beta
- Cargo change: Cargo produces an error if you use the name of a required dependency as a feature
- Upcoming deprecation:
mem::uninitializeddeprecated in upcoming version 1.38.0
Cargo offline support
Coding without reliable access to the internet? The new update adds
--offline support in Cargo, giving developers some more freedom in how (and where!) they code. (Take Rust to the skies, or a remote cabin.)
From the Rust announcement blog:
In Rust 1.36, a new Cargo flag has been stabilized:
--offline. The flag alters Cargo’s dependency resolution algorithm to only use locally cached dependencies. When the required crates are not available offline, and a network access would be required, Cargo will exit with an error. To prepopulate the local cache in preparation for going offline, use the
cargo fetchcommand, which downloads all the required dependencies for a project.
A blog from Nick Cameron regarding the new features suggests not to always depend upon –offline however, stating that errors may be more common and it does not allow for security/performance updates. Read more about this new feature and its uses on this blog post.
View the Cargo changelog for additional fixed bugs and features.
Update to the latest version
Users with a previous version of the language can install the latest update via rustup.
(Don’t have rustup? Visit this page to install this recommended tool.)