Commit 1e754ac
committed
Fix panic in annotated_snippet dependency (GitHub issue #4968).
* Internally, rustfmt preserves tabs and counts them as multiple
characters (based on configuration).
* The annoted_snippet dependency counts tabs as 1 character.
* If rustfmt produces an error on a line containing tabs,
annotated_snippet may think that the error is out of range and panic.
* Have rustfmt internally replace tabs with the corresponding number of
spaces, so that columns can be counted unambiguously.
* This change is based on PR #5039 by karyon, but with the code review
suggestions by camsteffen.1 parent ee2bed9 commit 1e754ac
2 files changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
| 577 | + | |
| 578 | + | |
577 | 579 | | |
578 | 580 | | |
579 | | - | |
| 581 | + | |
| 582 | + | |
580 | 583 | | |
581 | 584 | | |
582 | | - | |
583 | 585 | | |
584 | 586 | | |
585 | 587 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments