We can use
std::hint::unreachable_unchecked to give the compiler hints about what is/isn’t true. Should we add a wrapper macro (e.g.
std::hint::performance_assert!) for assertions that check their arguments in debug mode, but in release mode will cause the compiler to assume they’re true?
Of course this macro would only be usable in unsafe mode.
An example implementation with a motivating snippet: https://rust.godbolt.org/z/0AzKfM.