7 ms·
In your specific example `std::convert::Infallible` can be used: https://doc.rust-lang.org/std/convert/enum.Infallible.html https://doc.rust-lang.org/std/conver
by kawogi 8mo ago
In your specific example `std::convert::Infallible` can be used: https://doc.rust-lang.org/std/convert/enum.Infallible.html https://doc.rust-lang.org/std/convert/enum.Infallible.html
- ratmice 8mo agoSure, in the Result case, less in the option case. I didn't mention it because Infallible is documented and named specifically as an Error "The error type for errors that can never happen". The use of uninhabited types as an unreachable code optimization is useful beyond errors though.