Commit d73aa67
authored
Rollup merge of rust-lang#69385 - ridiculousfish:relax_get_unchecked, r=nagisa
Relax str::get_unchecked precondition to permit empty slicing
Prior to this commit, `str` documented that `get_unchecked` had
the precondition that "`begin` must come before `end`". This would appear
to prohibit empty slices (i.e. begin == end).
In practice, get_unchecked is called often with empty slices. Let's relax
the precondition so as to allow them.1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2486 | 2486 | | |
2487 | 2487 | | |
2488 | 2488 | | |
2489 | | - | |
| 2489 | + | |
2490 | 2490 | | |
2491 | 2491 | | |
2492 | 2492 | | |
| |||
2518 | 2518 | | |
2519 | 2519 | | |
2520 | 2520 | | |
2521 | | - | |
| 2521 | + | |
2522 | 2522 | | |
2523 | 2523 | | |
2524 | 2524 | | |
| |||
2563 | 2563 | | |
2564 | 2564 | | |
2565 | 2565 | | |
2566 | | - | |
| 2566 | + | |
2567 | 2567 | | |
2568 | 2568 | | |
2569 | 2569 | | |
| |||
2612 | 2612 | | |
2613 | 2613 | | |
2614 | 2614 | | |
2615 | | - | |
| 2615 | + | |
2616 | 2616 | | |
2617 | 2617 | | |
2618 | 2618 | | |
| |||
0 commit comments