Commit dcc59c0
committed
Auto merge of #26087 - fitzgen:improve-suggestion-hueristics, r=Aatch
This makes the maximum edit distance of typo suggestions a function of the typo'd name's length. FWIW, clang uses this same hueristic, and I've found their suggestions to be better than rustc's. Without something like this, you end up with suggestions that aren't related at all when there are short variable names.
See also #20028 (comment)File tree
4 files changed
+35
-14
lines changed- src
- librustc_resolve
- test/compile-fail
4 files changed
+35
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3206 | 3206 | | |
3207 | 3207 | | |
3208 | 3208 | | |
3209 | | - | |
3210 | | - | |
3211 | | - | |
3212 | | - | |
| 3209 | + | |
3213 | 3210 | | |
3214 | 3211 | | |
3215 | 3212 | | |
3216 | | - | |
| 3213 | + | |
3217 | 3214 | | |
3218 | 3215 | | |
3219 | 3216 | | |
| |||
3229 | 3226 | | |
3230 | 3227 | | |
3231 | 3228 | | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
3232 | 3234 | | |
3233 | | - | |
3234 | | - | |
3235 | 3235 | | |
3236 | 3236 | | |
3237 | 3237 | | |
| |||
3357 | 3357 | | |
3358 | 3358 | | |
3359 | 3359 | | |
3360 | | - | |
| 3360 | + | |
3361 | 3361 | | |
3362 | 3362 | | |
3363 | 3363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
| 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 | + | |
0 commit comments