Commit fb3906d
authored
fix: Suggest similar looking feature names when feature is missing (#15454)
### What does this PR try to resolve?
I recently depended on a package with `preserve-order` rather than
`preserve_order` and the error message didn't help me with the problem
so I figure I'd fix that. I also found other improvements along the way
- Suggest an alternative feature when a feature includes a missing
feature
- Suggest an alternative feature when a dependency includes a missing
feature
- Lower case error messages
- Re-frame prescriptive information as help
- Change plural "features" error messages to singular "feature" as they
can only ever have one (knowing an the `MissingFeature` string only has
one feature in it was important for doing a `closest` match on the
feature).
### How should we test and review this PR?
### Additional informationFile tree
9 files changed
+172
-62
lines changed- src/cargo/core
- resolver
- tests/testsuite
9 files changed
+172
-62
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
527 | | - | |
| 527 | + | |
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
533 | | - | |
534 | | - | |
535 | | - | |
| 533 | + | |
536 | 534 | | |
537 | 535 | | |
538 | 536 | | |
| |||
555 | 553 | | |
556 | 554 | | |
557 | 555 | | |
558 | | - | |
559 | | - | |
560 | | - | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
| |||
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
574 | | - | |
575 | | - | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
576 | 577 | | |
577 | 578 | | |
578 | 579 | | |
| |||
592 | 593 | | |
593 | 594 | | |
594 | 595 | | |
595 | | - | |
596 | | - | |
597 | | - | |
| 596 | + | |
598 | 597 | | |
599 | 598 | | |
600 | 599 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
| 153 | + | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
| 158 | + | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
163 | 171 | | |
164 | 172 | | |
165 | | - | |
166 | | - | |
| 173 | + | |
| 174 | + | |
167 | 175 | | |
168 | 176 | | |
169 | 177 | | |
170 | | - | |
171 | | - | |
| 178 | + | |
| 179 | + | |
172 | 180 | | |
173 | 181 | | |
174 | | - | |
| 182 | + | |
175 | 183 | | |
176 | | - | |
| 184 | + | |
177 | 185 | | |
178 | 186 | | |
179 | 187 | | |
180 | 188 | | |
181 | | - | |
182 | | - | |
| 189 | + | |
| 190 | + | |
183 | 191 | | |
184 | 192 | | |
185 | 193 | | |
186 | | - | |
187 | | - | |
| 194 | + | |
| 195 | + | |
188 | 196 | | |
189 | 197 | | |
190 | | - | |
| 198 | + | |
191 | 199 | | |
192 | | - | |
| 200 | + | |
193 | 201 | | |
194 | 202 | | |
195 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
| 342 | + | |
343 | 343 | | |
344 | 344 | | |
345 | | - | |
| 345 | + | |
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
364 | | - | |
| 363 | + | |
| 364 | + | |
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
| 245 | + | |
244 | 246 | | |
245 | 247 | | |
246 | | - | |
| 248 | + | |
247 | 249 | | |
248 | 250 | | |
249 | 251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1032 | 1032 | | |
1033 | 1033 | | |
1034 | 1034 | | |
1035 | | - | |
| 1035 | + | |
1036 | 1036 | | |
1037 | 1037 | | |
1038 | 1038 | | |
| |||
1159 | 1159 | | |
1160 | 1160 | | |
1161 | 1161 | | |
1162 | | - | |
| 1162 | + | |
1163 | 1163 | | |
1164 | 1164 | | |
1165 | 1165 | | |
| |||
4767 | 4767 | | |
4768 | 4768 | | |
4769 | 4769 | | |
4770 | | - | |
| 4770 | + | |
4771 | 4771 | | |
4772 | 4772 | | |
4773 | 4773 | | |
| |||
0 commit comments