this post was submitted on 11 Dec 2025
32 points (100.0% liked)
Rust
7566 readers
7 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
The never type comes more from type theory and isn't common in other languages (though TS has
never). Similar to 0 or the null set, it exists as a "base case" for types. For example, where you have unions ofT1 | T2 | ..., the "empty union" is the never type. Similarly, for set theory, a union of no sets is the null set, and in algebra, the summation of no numbers is 0.In practice, because it can't be constructed, it can be used in unique ways. These properties happen to be super useful in niche places.