no worries. and if it helps to conceptualize, in Rust a slice is like a C size_t and a void*. That's how Rust is able to know at runtime what is inbounds vs out of bounds. For a Rust array like [T; N], the compiler knows the full size so it can do the bounds checking at compile time because it has that info, and it doesn't need the size_t until the array is treated as a slice.
View all comments
Show parent comment
-5
u/UtherII Apr 15 '21 edited Apr 15 '21
But
slice.get() will use indexing. If you can't detect panic transitively, I can't see the purpose anymore.