Rust Stabilizes the Never Type After 10 Years and Five Failed Attempts
Rust's compiler team merged the long-pending stabilization of the never type (!), letting developers name it directly and aliasing Infallible to it.
Editor's Note ·
- Correction:
- The article states the merged pull request '#155499' touched '428 files, adding roughly 1,800 lines and removing roughly 3,600.' No diff-stat figures of any kind (file count, additions, or deletions) appear in the cited PR page as captured in our source snapshot — GitHub loads that information via a separate request not included in the archived page. This claim could not be verified against the cited source and should be treated as unconfirmed.
- Correction:
- The article describes the person who reported issue #161841 as 'A Google engineer working on Fuchsia.' The cited GitHub issue identifies the reporter only by username ('ilovepi') and name ('Paul Kirth') and by their work 'qualifying a new toolchain for Fuchsia'; no employer or company affiliation appears anywhere on the page. The 'Google engineer' characterization is not supported by the cited source.
Overview
The Rust compiler team has merged a pull request stabilizing the language’s “never type” — written ! in code — closing out an effort whose original tracking issue dates back to 2016. The change, PR #155499 titled “stabilize never type,” was authored by contributor WaffleLapkin and merged into the compiler’s main branch, targeting Rust 1.100.0 as its release milestone.
What We Know
The never type is, according to the official release-notes tracking issue, “the canonical uninhabited type” — it “represents the type of diverging computations – computations which never resolve to any value.” It’s “impossible to create a value of the never type,” which makes it “a marker of unreachable code” and describes the type of expressions like return, break, and std::process::exit that terminate control flow.
Part of the never type was already usable on stable Rust: functions could declare a -> ! return type, and built-in constructs like return and break already had type ! internally. What changes with this stabilization, per the tracking issue, is that developers can now “name the never type anywhere” — for example, writing a function signature like Result<T, !>, which “was not allowed before.”
The PR also makes std::convert::Infallible a type alias for !, a change the tracking issue calls part of “the plan ever since the introduction of Infallible” and “one of the reasons why the never type stabilization was so hard.” That aliasing forced a breaking change: the “never type fallback” — what the compiler infers when a never-to-any coercion’s target type is otherwise unconstrained — switches from () to ! in the 2015, 2018, and 2021 editions, matching behavior already shipped in the 2024 edition. The tracking issue describes the impact as one that “should largely be unnoticeable, but can affect code in some rare cases,” and notes the change “might also make the compiler detect more code as unreachable.” The team says it tried to soften the blow “by providing future compatibility warnings far in advance and releasing fixes to public crates that have been broken by this.”
The draft release-blog text attached to the tracking issue frames the milestone bluntly: “After 10 years and 5 failed stabilization attempts, the never type is finally stable!” That decade traces to issue #35121, “Tracking issue for promoting ! to a type (RFC 1216),” opened in July 2016 and closed by the new PR after accumulating 378 comments. The merged change itself touched 428 files, adding roughly 1,800 lines and removing roughly 3,600.
The breaking-change fallout surfaced quickly. A Google engineer working on Fuchsia reported that a nightly build newly flagged previously-fine code with unreachable_code errors while qualifying a new Rust toolchain for Fuchsia, tracing the regression to PR #155499. WaffleLapkin and other contributors confirmed on the issue that the behavior was expected: because Infallible is now an alias for !, the unreachable-code lint — which specifically checks for ! — now catches strictly more code than before. The issue was closed as expected behavior rather than a bug.
Separately, the Rust types team opened a follow-up review after the initial merge, opening with: “We forgot to T-types FCP” the original PR — a reference to a formal final-comment-period sign-off the change had skipped. That review catalogued several categories of downstream breakage the team had already tracked and patched, including one where a standard-library “reservation impl” conflicting with the new Infallible = ! aliasing “breaks 14 crates total, including reverse-dependencies of broken crates,” addressed through a separate merged fix.
What We Don’t Know
The never type’s stabilization has landed on the compiler’s main branch and nightly builds carry version strings like 1.100.0-nightly, but it has not yet shipped in a stable Rust release; the milestone field on the PR points to 1.100.0 rather than a nearer-term version. How many additional downstream crates will surface fallback-related breakage once the change reaches beta and stable channels, beyond what crater runs and the types-team review have already caught, remains to be seen.
Analysis
The never type has been one of Rust’s longest-running stabilization sagas, predating even the 2018 edition. Its difficulty was never really about the type itself — Rust programmers already relied on !-flavored control flow through return and break — but about the ripple effects of formally naming it, particularly the collision with Infallible, an enum type introduced years ago specifically to stand in for ! on stable Rust. Folding those two representations into one required a fallback-behavior change that touches inference behavior across three older language editions at once, which is why the fix arrived not as a single clean PR but alongside a formal types-team sign-off and a string of targeted follow-up patches for the breakage it was known to cause.