> Newbie to rust, but surely there must be a way to disable bounds checking in rust, right??
There's an unsafe method to not do bounds-checking, keeping in mind that indexing outside the collection is UB. It's usually a better idea to e.g. use iterators, or try and nudge the optimiser towards removing the bounds checks.
> disables it for optimised builds
A compiler flag to add UBs to a valid (though not correct) program is not considered a great idea by the rust team.
There's an unsafe method to not do bounds-checking, keeping in mind that indexing outside the collection is UB. It's usually a better idea to e.g. use iterators, or try and nudge the optimiser towards removing the bounds checks.
> disables it for optimised builds
A compiler flag to add UBs to a valid (though not correct) program is not considered a great idea by the rust team.