Updates

Rust proposal aims to make never type ergonomics easier

Rust is revisiting `!` with a limited coercion idea aimed at real code, so impossible states stop feeling like a type-system puzzle.

Nina Kowalski··2 min read
Published
Listen to this article0:00 min
Rust proposal aims to make never type ergonomics easier
Source: preview.redd.it

Rust’s never type already means impossibility, but in everyday code it still behaves like a sharp tool with the safety cover on. A May 27 pre-RFC on Rust Internals proposed improving the ergonomics of `!` so it can show up in mainstream code without becoming more work than it saves.

The pitch is deliberately narrow. It would add a limited form of coercion and try to move the discussion away from abstract questions like whether `Foo<!>` is inhabited. That matters because the practical pain is not in proving the type theory; it is in writing code that models unreachable states, early exits, or exhaustive control flow without tripping over awkward conversions and extra boilerplate.

AI-generated illustration
AI-generated illustration

Rust already gives `!` a clear meaning. The reference says it is a type with no values, representing computations that never complete, and that expressions of type `!` can coerce into any other type. It also says `!` can currently appear only in function return types. The standard library documentation uses `Result<String, !>` as a concrete example of an impossible error type, where the `Err` branch can never happen.

That makes the pre-RFC feel less like a reinvention than a cleanup pass on a language feature Rust already understands. In practice, it could make APIs that rely on uninhabited states easier to read and easier to use, especially when a function must prove that a branch cannot return or that a generic parameter is intentionally impossible. The proposal is not trying to widen the language recklessly; it is trying to make the existing behavior feel safer and more predictable in ordinary code.

The idea also sits inside a longer Rust effort. The never-type initiative RFC set out to promote `!` into a full-fledged type equivalent to an enum with no variants, while also adjusting default inference fallback to avoid breakage. That caution came from experience: a 2018 Rust Internals discussion said an earlier inference change had been dropped after it broke code that had previously inferred `()`.

Rust 2024 has already been through that kind of careful evolution. Rust 1.85.0 stabilized the edition on February 20, 2025, and the Rust project had already flagged the never type as one of the edition’s long-awaited pieces. The new pre-RFC keeps that arc going, not by making `!` bigger, but by making it less clumsy where ordinary Rust users actually feel it.

This article was produced by Prism’s automated news system from verified source data, official records, and press releases, then run through automated quality and moderation checks before publishing. The system is built and supervised by the people who set the standards it runs under. Read our full AI policy.

Did this article answer your question?

Discussion

More Rust Programming News

Rust proposal aims to make never type ergonomics easier | Prism News