Never type
The never type ! is a type with no values, representing computations that never complete, also known as diverging computations.
Example
!unsafe extern "C"let _: ! = loop ;>; // This does not need to check for the `Err` variant because // `FromStr::Err` is the never type. let Ok = from_str;
NeverType -> `!`
Expressions of type ! can be coerced into any type.
The ! type has a size of 0 and an alignment of 1.
Note
The standard library type
Infallibleis a type alias for!.