Commit ae77516
authored
Rollup merge of #155820 - Zalathar:range, r=Kivooeo
Avoid improper spans when `...` or `..=` is recovered from non-ASCII
- Fixes #155799
Adjusting span endpoints by `BytePos(1)` is almost always bad news.
In this case, the code assumed that it was skipping over a single ASCII character. But in the presence of parser recovery from other non-ASCII characters this resulted in an ICE due to bad string indexing when emitting suggestions.4 files changed
Lines changed: 388 additions & 14 deletions
File tree
- compiler/rustc_parse/src
- parser
- tests/ui/parser
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1140 | 1140 | | |
1141 | 1141 | | |
1142 | 1142 | | |
1143 | | - | |
1144 | 1143 | | |
1145 | 1144 | | |
1146 | 1145 | | |
1147 | | - | |
| 1146 | + | |
1148 | 1147 | | |
1149 | 1148 | | |
1150 | | - | |
| 1149 | + | |
1151 | 1150 | | |
1152 | 1151 | | |
1153 | 1152 | | |
1154 | 1153 | | |
1155 | 1154 | | |
1156 | 1155 | | |
1157 | 1156 | | |
1158 | | - | |
1159 | 1157 | | |
1160 | 1158 | | |
1161 | | - | |
| 1159 | + | |
1162 | 1160 | | |
1163 | 1161 | | |
1164 | 1162 | | |
1165 | | - | |
| 1163 | + | |
1166 | 1164 | | |
1167 | 1165 | | |
1168 | 1166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1225 | 1225 | | |
1226 | 1226 | | |
1227 | 1227 | | |
1228 | | - | |
| 1228 | + | |
1229 | 1229 | | |
1230 | 1230 | | |
1231 | 1231 | | |
| |||
1243 | 1243 | | |
1244 | 1244 | | |
1245 | 1245 | | |
1246 | | - | |
1247 | | - | |
1248 | | - | |
| 1246 | + | |
| 1247 | + | |
1249 | 1248 | | |
1250 | | - | |
1251 | | - | |
1252 | | - | |
1253 | | - | |
| 1249 | + | |
1254 | 1250 | | |
1255 | 1251 | | |
1256 | 1252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
0 commit comments