After a decade and five failed attempts, Rust finally stabilizes the never type
by Paul

After a decade and five failed attempts, Rust finally stabilizes the never type

The Rust project has released version 1.100 of the systems programming language, headlined by the stabilization of the never type, a change ten years in the making that succeeded after five prior stabilization attempts. Spelled ! in code, the never type represents computations that never produce a value, such as infinite loops or expressions that terminate control flow like return and break. While developers could previously use it as a return type, Rust 1.100 allows naming it anywhere, for instance writing Result to describe operations that cannot fail. The standard library's Infallible type is now an alias for !, unifying the two, a long-planned change that required a breaking adjustment to never-type fallback in older editions, which the team says should be largely unnoticeable thanks to advance warnings and fixes shipped to affected public crates.

The release also stabilizes the core of the allocator_api feature, letting library authors define custom allocators for use with standard library types such as Vec and Box through the new Allocator trait. Other additions on the standard library side include a DropGuard API and support for conjuring zero-sized types.

On the tooling front, Cargo gains several security- and reliability-oriented improvements. A new stabilized min-publish-age mechanism, commonly known as dependency cooldowns, allows projects to delay picking up freshly published package versions for a configurable window, protecting against malicious releases that are typically caught by scanners or the community within hours or days. Cargo can now also report unused dependencies and takes steps to reduce cache collisions, changes the team warns may affect build processes that relied on previous behavior, with migration guidance published alongside the release.

Paul
Written by Paul
Follow
soul1472Tanath
duttyend found this interesting
Add as a preferred source on Google
Rust iconRust
  162
  • ...

Rust is a multi-paradigm, general-purpose programming language designed for performance, type safety, and concurrency. It ensures memory safety by guaranteeing that all references point to valid memory without the need for a garbage collector. Rust's top features include static typing, type safety, and detailed compiler explanations. It is rated 4.4 and is a popular choice among developers.

Other apps mentioned in this article

No comments so far, maybe you want to be first?