deniz.in

Markets

Weather

Loading weather

· via Hacker News – Front Page (native)

Rust 1.100 stabilizes the never type, extern "custom" and custom allocators

Rust 1.100.0 stabilizes the never type and extern "custom", brings custom allocators into the standard library, and gives Cargo its own lint system plus dependency cooldown support.

Rust 1.100 stabilizes the never type, extern "custom" and custom allocators

The Rust project has shipped version 1.100.0, a language-heavy update that stabilizes the never type, extern "custom" declarations and custom allocators in the standard library. According to the release notes published on the rust-lang GitHub repository, which also reached the front page of Hacker News, the release ships alongside a sizable Cargo update and an unusually long list of compatibility changes.

The never type is stable

The never type, written !, describes expressions that can never produce a value, such as return, break or a call that unconditionally diverges. Its stabilization closes one of the oldest gaps between what the language was designed to express and what stable code could actually use. The release notes also fold Infallible into the picture: it is now a type alias for !, and the type gains AsRef and AsMut implementations. The never type fallback, which previously behaved differently across editions, now resolves to ! everywhere — a change the notes flag under compatibility because it can surface in type inference.

extern "custom" and compiler changes

On the foreign-function side, extern "custom" lets crates declare functions with a custom ABI label rather than one of the compiler's built-in strings, aimed at toolchains and targets that define their own calling conventions. Elsewhere in the language, repeated #[repr(..)] attributes are now linted against, the hard error for repr(align) fields inside a repr(packed) type has become a deny-by-default lint (aligned_fields_in_packed), and the dropping_references, dropping_copy_types and undropped_manually_drops lints now also cover drop_in_place. Volatile accesses to non-addressable memory are now allowed to trap. In the compiler, -Cprofile-sample-use is stabilized for sample-guided optimization, and the next-generation trait solver is now the default for the orphan check.

Custom allocators and stabilized APIs

The big library story is custom allocators. std::alloc::Allocator, together with Global and System, is now stable, along with Allocator implementations for references, Box, Rc and Arc, and a fleet of allocator-aware constructors: Box::new_in, Vec::new_in, Vec::with_capacity_in, Vec::from_raw_parts_in and counterparts for extracting raw parts together with the allocator. The notes warn that some Box implementations were generalized to arbitrary allocators, which can trigger new type inference errors in existing code.

A batch of smaller APIs also landed, including Box::take, Box::map, Rc::map, Arc::map, bool::toggle, str::trim_prefix and str::trim_suffix, Vec::from_fn, core::mem::DropGuard, UnsafeCell::replace and Child::main_thread_handle.

Cargo gains lints, cooldowns and a new cache layout

Cargo introduces its own linting system: certain warnings are now emitted as lints configurable through the [lints.cargo] table, including a new built-in unused-dependency check exposed as cargo::unused_dependencies. More notable for teams watching their supply chain, minimum publish age — also called dependency cooldowns under RFC 3923 — lets the resolver ignore crate versions published more recently than a configured window, unless they are already recorded in Cargo.lock.

cargo install now reuses the lockfile shipped inside the .crate tarball by default, which makes --locked a no-op. Intermediate build artifacts have also moved to a new directory layout; the notes advise tools to locate artifacts through Cargo's JSON messages instead of the directory structure, which is explicitly not a stable interface.

Platform moves and compatibility notes

On platform support, wasm32-wasip3 is promoted to Tier 2, i686-pc-windows-gnu becomes a Tier 2 target without host tools, and powerpc64-sony-ps3 joins as a new Tier 3 target. In the libraries, ENOTSUP now maps to ErrorKind::Unsupported, and a soundness issue in the SGX wait queue's unsafe list was fixed.

The compatibility list deserves attention before upgrading: closures now capture variables used in if let more precisely, which may cause new errors; dyn-compatibility of trait objects is checked in more places; box patterns are no longer syntactically allowed; and the Iterator::{min,max}(_by_key) family changed which Ord methods they call — harmless for correct implementations, but potentially behavior-changing for inconsistent ones. The standard library moved to Unicode 18.0.0 and the WASI SDK jumped from version 33 to 34. On ARM, -Ctarget-feature and -Ctarget-cpu values that would alter the ABI are now rejected as hard errors, and the notes disclose that several ARMv7-A hardfloat targets erroneously required the VFPv3-D32 FPU from 1.94 through 1.100; affected builds can pass -Ctarget-feature=+d32. Rustdoc also adds an invalid_markdown_table lint.

Why it matters

The never type is the headline: it gives library authors a way to encode "this branch cannot happen" directly in the type system and removes a long-standing workaround shaped around Infallible. Custom allocators matter most outside conventional server software — kernels, embedded targets and arenas all need explicit control over where memory comes from. And Cargo's cooldowns arrive as the ecosystem pays increasing attention to supply-chain incidents, giving teams a built-in mechanism to avoid automatically resolving to the very newest version of a dependency. Few Rust point releases bundle three changes of this weight at once.

  • #rust
  • #cargo
  • #programming-languages
  • #compilers