Rust 1.100: 3 errors become zero with the never type
Rust 1.100.0 shipped today, and the never type took 10 years and 5 failed stabilization attempts to land. I installed both 1.99.0 and 1.100.0 and compiled the same file against each: 3 errors on 1.99, zero on 1.100 — and the new Cargo features that shipped alongside it are the ones that will actually change your builds.
The never type, before and after
The never type, spelled ! , is the type of computations that never return a value. You could already write it as a function's return type ( -> ! ), but naming it anywhere else — inside a Result , in a type annotation, in a generic argument — was an experimental feature gated behind issue #35121 since 2016. This release finally stabilizes it, and also makes Infallible an alias for !…