Re:The Rust Performance Book
by vbezhenar on Tuesday November 17, 2020 @09:07AM
(#25123853)
Is there any way to treat bounds check as a warning to eliminate it early?
[ Parent
| on HN ]
Re:The Rust Performance Book
by staticassertion on Saturday November 21, 2020 @06:42PM
(#25173580)
A 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.
Re:The Rust Performance Book
by gameswithgo on Tuesday November 17, 2020 @09:25AM
(#25124032)
not 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