Skip to content
ES EN
Theme: automatic

Rust 1.100: Update and Test the Never Type and Cargo's Cooldown Feature

A practical guide to updating to Rust 1.100, reviewing the impact of the never type, and safely enabling Cargo's dependency cooldown.

Software engineering

Rust 1.100.0 is the first stable three-digit version and arrives with a long-awaited feature: the ! type. We set out to update an existing project, verify that nothing breaks, and enable Cargo's new defense against newly published versions. This guide follows that journey, supported by the official release notes and InfoQ's coverage.

A developer's terminal showing a Rust project compiling after updating the toolchain
Updating and compiling is the first indicator of the change's impact.

What you need

You'll need rustup installed and a Rust project under version control, so you can revert if anything warns about unreachable code. It's worth noting that Rust 1.99 is no longer supported and 1.101 will arrive following the six-week cycle, around December 24, 2026. Also, review what the never type is in the stabilization goal: a decade of work and five failed attempts.

  1. Create a test branch and verify that the project compiles and passes tests with your current version.
  2. Update the toolchain with rustup update stable and confirm the installed version.
  3. First, update dependencies and recompile: fixes for the most used crates have already been published.
  4. Review new warnings, especially those for unreachable code, and decide if any adjustments are needed.
  5. Add the cooldown setting to your Cargo configuration and validate that resolution still works.

Update and monitor the never type change

The command is as indicated in the release notes. Afterward, we check which compiler we have:

rustup update stable
rustc --version

What to expect: std::convert::Infallible becomes an alias for !, so APIs that already used Infallible transparently accept the new type. To achieve this, the 2015, 2018, and 2021 editions change the never type's fallback behavior from () to !, matching what the 2024 edition already did. The described impact is almost imperceptible, although more code might be marked as unreachable.

If something fails during the update, don't touch your code yet: first, upgrade your dependencies. Now you can name the type in signatures like Result<T, !> to express an operation that cannot fail.

Enable dependency cooldown in Cargo

The version adds an optional setting that delays the adoption of newly published versions, intended as a defense against malicious crate publications. In Cargo's configuration, it's declared as follows:

[registry]
global-min-publish-age = "3 days"

There are important nuances. According to comments collected on Hacker News, a user detected in the beta that cargo install ignores the setting and that an update could degrade a forced security fix; the release notes mention this as a known warning. Therefore, cooldown should not hinder urgent patches: let normal updates wait, but apply security advisories immediately.

Cargo configuration file open in an editor with the minimum publish age setting
A single configuration line adds a waiting window for new dependencies.
Tip If a security advisory requires a very recent version, don't rely on cooldown to let it through: manually verify which version was resolved. And remember that the setting is optional, not a universal guarantee.

Other new features worth trying

The core of the allocator API is now stable: the Allocator trait allows defining custom allocators for Vec and Box, and is the basis of the Allocators 1.0 project. There are criticisms in the internals forum: the current design does not support inline storage because moves invalidate internal pointers.

  • core::mem::DropGuard: executes a closure on any scope exit.
  • std::mem::conjure_zst: for zero-sized types in unsafe code.
  • Small ergonomic improvements: bool::toggle, str::trim_prefix, str::trim_suffix, and Box::map, which several readers pointed out in the discussion thread for not appearing in the official blog.

Original source: infoq.com

Article generated with AI.larebelion

Kernel

· Director of Technology · Spain

«An almost invisible edition change and one line of configuration: that's how security is improved without disrupting the team's workflow.»

Comments (0)

No comments yet. You can be the first.

Write a comment