RC RANDOM CHAOS

Rust 1.100: Never Type Stabilized After 10 Years

· via Hacker News

Original source

Rust 1.100

Hacker News →

Rust 1.100 stabilizes the never type (!) following a decade-long effort marked by five prior failed attempts. This uninhabited type represents computations that diverge—those never returning a value—and uniquely coerces into any other type. The change makes Infallible an alias to !, though this required altering the never type fallback in earlier language editions, potentially affecting uncommon cases where code ignores generic function results.

The release also debuts the core allocator API, letting library authors define custom allocators for Vec and Box as a foundation for broader collection support. DropGuard streamlines resource cleanup by executing a closure when variables leave scope, enabling rollback patterns for transaction-like operations. conjure_zst provides a dedicated unsafe method for constructing zero-sized types, replacing ad-hoc transmute workarounds. Cargo gains warnings for unused dependencies at the package level, avoiding the false positives that plague the compiler’s per-crate lint in multi-target builds—though this detection only triggers when all build targets are compiled together.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.