Commit 4891c00
committed
Auto merge of #29984 - Manishearth:slice-assert, r=alexcrichton
I'd like to have the message print out the index and length values like it does elsewhere, but I'm not sure how to do that without affecting perf here. Will `assert!(cond, "index out of bounds got {} but len is ", idx, len)` make things slower? It calls `panic_fmt` which is marked as cold but also calls `format_args!`, and I don't know if that allocates or does any heavy lifting.
cc @alexcrichton @gankro2 files changed
+23
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
569 | 581 | | |
570 | 582 | | |
571 | 583 | | |
572 | 584 | | |
573 | 585 | | |
574 | 586 | | |
575 | | - | |
576 | | - | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
577 | 592 | | |
578 | 593 | | |
579 | 594 | | |
| |||
614 | 629 | | |
615 | 630 | | |
616 | 631 | | |
617 | | - | |
618 | | - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
619 | 637 | | |
620 | 638 | | |
621 | 639 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1441 | 1441 | | |
1442 | 1442 | | |
1443 | 1443 | | |
| 1444 | + | |
1444 | 1445 | | |
1445 | 1446 | | |
1446 | 1447 | | |
| |||
0 commit comments