bors 24921df7bd Auto merge of #7039 - phansch:melt-ice, r=flip1995
tabs_in_doc_comments: Fix ICE due to char indexing

This is a quick-fix for an ICE in `tabs_in_doc_comments`. The problem
was that we we're indexing into possibly multi-byte characters, such as '位'.

More specifically `get_chunks_of_tabs` was returning indices into
multi-byte characters. Those were passed on to a `Span` creation that
then caused the ICE.

This fix makes sure that we don't return indices that point inside a
multi-byte character. *However*, we are still iterating over unicode
codepoints, not grapheme clusters. So a seemingly single character like y̆ ,
which actually consists of two codepoints, will probably still cause
incorrect spans in the output. But I don't think we handle those cases
anywhere in Clippy currently?

Fixes #5835

changelog: Fix ICE in `tabs_in_doc_comments`
2021-04-14 04:53:24 +00:00
..
2021-04-13 14:10:40 -05:00
2021-04-06 13:00:36 -05:00
2021-04-06 15:05:00 -05:00
2021-04-06 13:00:36 -05:00
2021-03-31 14:06:27 -05:00
2021-03-31 14:06:27 -05:00
2021-04-06 15:05:00 -05:00
2021-04-06 15:05:00 -05:00
2021-04-06 15:05:00 -05:00
2021-04-13 14:10:40 -05:00
2021-03-31 14:06:27 -05:00
2021-03-31 14:06:27 -05:00
2021-04-06 13:00:36 -05:00
2021-04-06 15:05:00 -05:00
2021-04-08 22:49:48 +02:00
2021-04-06 15:05:00 -05:00
2021-03-25 22:30:14 -04:00
2021-03-31 14:06:27 -05:00
2021-04-12 18:35:47 +02:00
2021-04-06 15:05:00 -05:00
2021-04-06 15:05:00 -05:00
2021-04-06 15:05:00 -05:00
2021-03-31 14:06:27 -05:00
2021-03-31 14:06:27 -05:00
2021-03-31 14:06:27 -05:00