5 ms·
Oh thanks for clearing that up! Is there any specific reason why the rust compilier currently doesn't check that a static int accessing into a known length slic
by b0b_d0e 12y ago
Oh thanks for clearing that up! Is there any specific reason why the rust compilier currently doesn't check that a static int accessing into a known length slice doesn't result in a compile error? (I'm only referring to cases where the index you are trying to access is known at compile time as well as the length of the slice)
- nikbackm 12y agoIt would be inconsistent and not really that helpful. How often do you use (invalid) constant indexes with fixed length arrays? Probably better to handle all out-of-bounds errors the same way.