4 ms·
If the error is flagrant enough e.g. let a = [0;4]; println!("{}", a[5]); or let a = 128u8 + 128u8; the compiler may tell you, but in general yo
by masklinn 6y ago
If the error is flagrant enough e.g.
let a = [0;4];
println!("{}", a[5]);
or
let a = 128u8 + 128u8;
the compiler may tell you, but in general you can add any two `u8` or index an array with any `usize`, the issues will be checked for at runtime (or not at all for the overflow in release mode, by default).