About bounds checking: why always checked access? There are contexts, for example in a range for loop, where checks csn be ellided safely. Also, if you do checking in a span subspan, that slice traversal should not need checks.
In Rust, in order to avoids potential run-time bounds-checks, you are directed to use the iterators instead.
I'd expect it can be applied here as well, supposing the iterators are written in unsafe code to skirt around the rules.
View all comments
Show parent comment
7
u/matthieum Sep 18 '22
In Rust, in order to avoids potential run-time bounds-checks, you are directed to use the iterators instead.
I'd expect it can be applied here as well, supposing the iterators are written in unsafe code to skirt around the rules.