Back

Rust 1.100.0 released with never type, allocator API and Cargo changes
SiTech AI Team2 min read

Rust 1.100.0 released with never type, allocator API and Cargo changes

Rust 1.100.0 is available via rustup and stabilizes the never type, allocator API parts, DropGuard, Cargo unused dependency warnings, build cache changes and minimum publish age resolution.

Rust 1.100.0 is now available through rustup update stable. The release stabilizes the never type, core allocator API parts, core::mem::DropGuard, core::mem::conjure_zst, and several Cargo features including unused dependency reporting, build directory layout changes and minimum publish age checks.

Never type reaches stable

After 10 years and five failed stabilization attempts, the never type, spelled !, is stable. It is the canonical uninhabited type for diverging computations and can be coerced to any other type. This release also allows naming ! anywhere, including Result, and changes Infallible to be an alias to the never type. In editions before 2024, the never type fallback changes from () to !, which may affect rare code and make more code appear unreachable.

Allocator API and DropGuard

Rust 1.100.0 stabilizes core parts of allocator_api, allowing custom allocators through the Allocator trait with Vec and Box. The release also introduces core::mem::DropGuard, which runs a closure when dropped and supports dismiss to return the guarded variable without running the destructor. core::mem::conjure_zst provides a dedicated unsafe way to create values of zero-sized types.

Cargo improvements

Cargo now reports unused dependencies, controlled by the [lints.cargo] table, with warnings appearing when all possible build targets are built. No warning is shown for unused dev-dependencies. The build directory now consistently applies the build configuration hash by organizing directories around build steps and moving the hash to the parent directory. Cargo also stabilizes minimum publish age resolution, letting users set global-min-publish-age in .cargo/config.toml and skip versions published more recently than the configured age. cargo install ignores the setting for both the installed crate and its dependencies.

Stabilized APIs and other changes

The release adds many stabilized APIs, including Box::new_in, Vec::new_in, Child::main_thread_handle, bool::toggle, Box::take, Box::map, Rc::map, Arc::map, str and slice trim helpers, Path::trim_prefix, Vec::from_fn and others listed in the release notes. Changes in Rust, Cargo and Clippy are documented separately, and the Rust team thanked contributors.

Sources: blog.rust-lang.org

SiTech

SiTech — AI-powered web development

We build fast, modern websites and bring AI into real business workflows. Have a project or a question? We'd love to help.