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
Add overflow checking for `str::get` with inclusive ranges
Fixesrust-lang#42401
Two commits here:
1. The first makes `str::index` just call `SliceIndex<str>::index`. It's intended to have no behavior change, except where the two methods were inconsistent.
2. The second actually adds the overflow checking to `get(_mut)` (and tests for it)
Repro: https://is.gd/lVsdTA
(The latter with
[]
correctly panics with "attempted to index str up to maximum usize".)The text was updated successfully, but these errors were encountered: