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 in annotated_snippet dependency (#4968).
* Internally, rustfmt preserves tabs and counts them as multiple
characters (based on configuration).
* The annotated_snippet dependency always counts tabs as 1 character.
* If rustfmt tries to display an error on a line containing tabs,
the indicies are mismatched.
* In the extreme case, annotated_snippet may try to access out-of-range
indices, and panic.
* This change is based on the code review by camsteffen on PR #5039 by
karyon: have rustfmt internally replace tabs with the corresponding
number of spaces, so that columns/indices in the buffer passed to
annotated_snippet are counted (unambiguously and) the same.
0 commit comments