Rust 1.36.0 update: Cargo –offline support for Cargo and new stabilizations

Share

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:

  • Stabilized Future trait: Future, an asynchronous computation value, now is fully stable.
  • Function changs:MaybeUninit now instead of mem::uninitialized
  • HashMap‘s implementation replaced with hashbrown::HashMap implementation.
  • alloc crate stabilized: With the new release, parts of the standard library are now available in the alloc crate. The announcement blog suggests that library maintainers that depend upon allocation primitives to function should “consider making your library #[no_std] compatible”.
  • 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>
  •  constAPIs: Including Layout::from_size_align_unchecked
  • dbg! macro now supports multiple arguments
  • Various stabilized APIs: Including  task::Waker and task::Poll
  • 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::uninitialized  deprecated in upcoming version 1.38.0

SEE ALSO: The trendy five: Blazing hot GitHub repos in June 2019

View the full list of changes on GitHub.

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 fetch command, 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.

SEE ALSO: How to take the pain out of patching Linux and Windows systems at scale

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.

rust

(Don’t have rustup? Visit this page to install this recommended tool.)

The post Rust 1.36.0 update: Cargo –offline support for Cargo and new stabilizations appeared first on JAXenter.

Source : JAXenter