arraysrust

Why doesn’t Rust have reverse indexing / indexing from end for arrays?


Since the size of array types in Rust are already known at compile-time, I was wondering what might be the reason for not having reverse indexing? By reverse indexing, I mean arr[-1] to access the last element of array arr


Solution

  • I can think of several reasons: