Commit ab361f2
committed
Auto merge of #14647 - elchukc:refactor_pkg_activated_features, r=weihanglo
improve error reporting when feature not found in `activated_features`
Pulls the error message refactor out of #14593 (originally #13207) to improve error reporting when we fail to get the list of activated features enabled for the given package. It now fully lists the activated_features hashmap keys too.
From the [original author](#13207 (comment)):
> I moved `activated_features_int` into `activated_features` and `activated_features_unverified` as I was concerned of the performance cost of generating the full error when its not a fatal error and may occur many times.
Old vs new error message:
```diff
- activated_features for invalid package: features did not find PackageId { name: "bindep", version: "0.0.0", source: "[ROOT]/foo/bindep" } NormalOrDev
+ did not find features for (PackageId { name: "bindep", version: "0.0.0", source: "[ROOT]/foo/bindep" }, NormalOrDev) within activated_features:
+ [
+ (
+ PackageId {
+ name: "bindep",
+ version: "0.0.0",
+ source: "[ROOT]/foo/bindep",
+ },
+ ArtifactDep(
+ CompileTarget {
+ name: "[ALT_TARGET]",
+ },
+ ),
+ ),
+ (
+ PackageId {
+ name: "foo",
+ version: "0.0.0",
+ source: "[ROOT]/foo",
+ },
+ NormalOrDev,
+ ),
+ ]
```
r? weihangloFile tree
2 files changed
+25
-27
lines changed- src/cargo/core/resolver
- tests/testsuite
2 files changed
+25
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
322 | | - | |
323 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
324 | 346 | | |
325 | 347 | | |
326 | 348 | | |
| |||
340 | 362 | | |
341 | 363 | | |
342 | 364 | | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | 365 | | |
368 | 366 | | |
369 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1573 | 1573 | | |
1574 | 1574 | | |
1575 | 1575 | | |
1576 | | - | |
| 1576 | + | |
1577 | 1577 | | |
1578 | 1578 | | |
1579 | 1579 | | |
| |||
0 commit comments