2 ms·
Is there any way to treat bounds check as a warning to eliminate it early?
by vbezhenar 6y ago
Is there any way to treat bounds check as a warning to eliminate it early?
- gameswithgo 6y agonot globally no. isolating that kind of behavior to unsafe blocks is a priority to make it easier to audit. if you wanted globally unsafe memory C or Zig would be a more sensible choice
- staticassertion 6y agoA nice method I've found (and seems popular) is to use unsafe but use a debug_assert!. That way your tests will fail loudly if you hit the assertion, but you won't take a hit in production.