You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix panic message when RangeFrom index is out of bounds
Before, the `Range` method was called with `end = slice.len()`.
Unfortunately, because `Range::index` first checks the order of the
indices (start has to be smaller than end), an out of bounds index
leads to `core::slice::slice_index_order_fail` being called. This
prints the message 'slice index starts at 27 but ends at 10', which is
worse than 'index 27 out of range for slice of length 10'. This is not
only useful to normal users reading panic messages, but also for people
inspecting assembly and being confused by `slice_index_order_fail`
calls.
0 commit comments