{
  "id": 7114253,
  "title": "Stabilizing Rust's never type",
  "url": "https://urgent.news/2026/09/13/stabilizing-rusts-never-type",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-13T14:00:18.000Z",
  "source": {
    "name": "Lobsters",
    "slug": "lobsters",
    "url": "https://lwn.net/SubscriberLink/1091015/d9e48318ed242b41/"
  },
  "original_language": "en",
  "account": "In Rust, the never type is a special type denoted by an exclamation mark (!) that indicates a function never returns or a value can never occur. It has been used internally by the compiler but was considered unstable for a long time. On August 24, after over two years of work, Rust compiler contributor waffle finally stabilized the never type, despite needing a small breaking change to previous Rust editions to avoid impacting much real code.\n\nThere are two reasons for the existence of the never type: practical and philosophical. Practically, it allows for more efficient generic code by enabling the compiler to optimize out error branches in functions with infallible conversions. Philosophically, it simplifies type inference by treating infinite loops uniformly. It also automatically coerces to any other type, enabling type-system-driven dead-code elimination.\n\nHowever, stabilizing the never type required resolving a complex corner case. When converting from the never type to other types, the compiler could sometimes be unable to infer the concrete type of an expression, leading to potential compilation errors. To address this, a special rule was introduced: if an ambiguous type remained after type inference, assume it should be the designated fallback type. Prior to Rust 2024, this fallback type was the unit type (), and in Rust 2024, it was changed to the never type itself, effectively canceling out the implicit conversion. This change was technically a breaking change, as it could impact code inference for some cases, but the edition system allowed for backporting the new behavior to older editions.\n\nWhen stabilizing the never type, the standard library's Infallible type, which served the same semantic purpose, was planned to become a type alias for !. However, defining Infallible as ! could unintentionally create breaking changes due to implicit conversions. As both defining Infallible as ! and changing its default fallback type were breaking changes, they nearly canceled each other out, minimizing the impact on existing code.",
  "summary": null,
  "key_points": [
    "Never type denoted by exclamation mark (!) in Rust.",
    "Stabilization after two years of work by waffle.",
    "Breaking change required to avoid impacting real code."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}