3 ms·
> is tricking the compiler into producing the behavior you described not the expected and intended behavior? It might be what that programmer intended and expe
by lmm 2y ago
> is tricking the compiler into producing the behavior you described not the expected and intended behavior?
It might be what that programmer intended and expected, but they should not expect it. E.g. the current compiler might check for 0, and a future more optimized compiler might optimize out that check (because it knows the Option is not None) and then e.g. perform an out-of-bounds array access (if you were using that NonZeroU8 as an index into some kind of 1-based array).