2 ms·
> because the index checks are intrinsic to the Rust compiler This is false. The index checks are written in Rust code as an impl of the Index trait on [T]. T
by Manishearth 10y ago
> because the index checks are intrinsic to the Rust compiler
This is false. The index checks are written in Rust code as an impl of the Index trait on [T].
The checks being removed have nothing to do with this -- LLVM can prove that certain checks are unnecessary. C does the same, if you used a library that provided checked indexing.
What's different is that in Rust indexing is overall used much less often, because iterators are the dominant pattern, which completely sidesteps this pattern.