Rust Finally Stabilizes the Never Type After Two Years

Stabilizing Rust's Never Type

After more than two years of work, Rust contributor waffle stabilized the never type (!) in Rust 1.99. The change makes Infallible a type alias for ! and alters type inference fallback, which broke seven crates outright and impacted 3,300 others. Backports fixed 1,553 of those, and the team decided the simplification was worth the small breakage.

Even though it's not a complicated change, the Rust maintainers were not willing to break 3,300 crates.
  1. Georgelemental

    > For many years, the standard library has had an `Infallible` type to work around the unstable nature of the never type. It served the same semantic purpose as the never type, but did not have any special compiler support. Therefore, code using it would be technically correct but suboptimal (such as having an extra layer of tags in an enumeration or emitting dead code), because the optimizer would not always be able to remove references to `Infallible`.

    This is incorrect. The compiler has always treated `Infallible` as uninhabited, and used that fact for optimizations. The downside of its lack of compiler support is losing out on the coercions. (The article is excellent otherwise)

  2. xg15

    > After this change (and on the 2024 edition), the compiler assumes that T should be !, which doesn't implement Default, and therefore causes a compilation error.

    If ! can coerce to every type, why not treat it as if it implemented every trait too?

  3. cipherjim

    My favourite never type ability is when you need to conform to a trait that returns Result but your specific implementation can never produce an error.

    Return Result<T, !> and the compiler knows that callers never have to check the error case because by definition it can’t be constructed.

  4. LatticeAnimal

    Is it obvious to rust developers that "!" would be the never type? I frequently use "never" in typescript. I could imagine using the never type frequently in rust too. I feel like a longer more human-understandable name would've been a good decision here. (feels like more rust jargon that makes the language harder to learn)

  5. weinzierl

    Relevant talk by Waffle at RustWeek earlier this year:

    "When is never?"

    https://youtube.com/watch?v=3jM4cnEVrLc

More from this day

2026-09-12