Closed
Description
Arrays and Slices has an example at the bottom of the code example of an index out of bounds error, and the comment implies that it will cause a compiler error if you uncomment the line. But if you go ahead and uncomment the line the example will compile just fine and run until it panics because of the out of bounds error.
I figured out that all of the lines that borrow the xs
value seem to be what interferes with the compilers ability to preemptively catch the error, but it was pretty confusing to me as someone who doesn't work with compilers all that extensively.
Metadata
Metadata
Assignees
Labels
No labels