Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon

Rust 1.28 is here with global allocators, nonZero types and more

Save for later
  • 2 min read
  • 03 Aug 2018

article-image

The Rust team has announced a new version of their popular programming language. Mozilla's Rust system programming language has always been focused on safety, speed, and concurrency. This release adds more power to these features. Rust 1.28 provides more flexibility and ease to memory allocation with global allocators and NonZero types.

Global allocators


Global allocators allow a developer to define the memory allocation system used by a Rust program.  Previously, Rust did not allow changing the way memory is obtained, which prevented some use cases.

With Rust 1.28, the #[global_allocator] attribute is stable. This attribute will allow Rust programs to set their allocator to the system allocator, as well as define new allocators by implementing the GlobalAlloc trait.

Better error message formatting


Rust’s compiler has traditionally provided verbose and explicit error messages, along with suggestions for how to fix the problem.  Rust 1.28 introduces more detailed notes about why some error conditions arise.

The entire list of formatting changes is available on Github.

Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at €18.99/month. Cancel anytime

Library stabilizations


NonZero types are now a stable addition to the language. NonZero number types are wrappers around the standard unsigned integer types: NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU128, and NonZeroUsize. This provides easier to anticipate memory allocations and optimize program data placement.

A number of other libraries have also been stabilized; you can see the more detailed release notes for full details.

Cargo features


Rust’s cargo utility no longer lets users publish crates with build scripts that modify the src directory for an application. This eliminates bugs during the compilation process.

For more detailed release notes along with code snippets, you can read the Rust Language blog.

Will Rust Replace C++?
Say hello to Sequoia: a new Rust based OpenPGP library to secure your apps
Eclipse IDE’s Photon release will support Rust