Commit caca7f2
committed
Auto merge of #10606 - Muscraft:cargo-add-support, r=epage
Cargo add support for workspace inheritance
Tracking issue: #8415
RFC: rust-lang/rfcs#2906
This PR adds all the required support for workspace inheritance within `cargo-add`. It was split up across a few different PRs as it required `snapbox` support from #10581 and a new `toml_edit` version from #10603. `@epage` and I decided to go ahead with this PR and add in some of the changes those PRs made. `@epage's` name on the commits is from helping to rewrite commits and some very minor additions.
Changes:
- #10585
- Muscraft#1
- Muscraft#3
- Muscraft#2
- Muscraft#4
r? `@epage`137 files changed
Lines changed: 1149 additions & 79 deletions
File tree
- src/cargo/ops/cargo_add
- tests
- snapshots/add
- detect_workspace_inherit.in
- dependency
- src
- primary
- src
- detect_workspace_inherit.out
- dependency
- primary
- detect_workspace_inherit_features.in
- dependency
- src
- primary
- src
- detect_workspace_inherit_features.out
- dependency
- primary
- detect_workspace_inherit_optional.in
- dependency
- src
- primary
- src
- detect_workspace_inherit_optional.out
- dependency
- primary
- invalid_key_inherit_dependency.in
- dependency
- src
- primary
- src
- invalid_key_inherit_dependency.out
- dependency
- primary
- invalid_key_overwrite_inherit_dependency.in
- dependency
- src
- primary
- src
- invalid_key_overwrite_inherit_dependency.out
- dependency
- primary
- invalid_key_rename_inherit_dependency.in
- dependency-alt
- src
- dependency
- src
- primary
- src
- invalid_key_rename_inherit_dependency.out
- dependency-alt
- dependency
- primary
- merge_activated_features.in
- dependency
- src
- primary
- src
- merge_activated_features.out
- dependency
- primary
- overwrite_inherit_features_noop.in
- dependency
- src
- primary
- src
- overwrite_inherit_features_noop.out
- dependency
- primary
- overwrite_inherit_noop.in
- dependency
- src
- primary
- src
- overwrite_inherit_noop.out
- dependency
- primary
- overwrite_inherit_optional_noop.in
- dependency
- src
- primary
- src
- overwrite_inherit_optional_noop.out
- dependency
- primary
- overwrite_workspace_dep.in
- dependency
- src
- primary
- src
- overwrite_workspace_dep.out
- dependency
- primary
- overwrite_workspace_dep_features.in
- dependency
- src
- primary
- src
- overwrite_workspace_dep_features.out
- dependency
- primary
- unknown_inherited_feature.in
- dependency
- src
- primary
- src
- unknown_inherited_feature.out
- dependency
- primary
- testsuite
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| |||
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| |||
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| 82 | + | |
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
| |||
150 | 156 | | |
151 | 157 | | |
152 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
153 | 165 | | |
154 | 166 | | |
155 | 167 | | |
| |||
161 | 173 | | |
162 | 174 | | |
163 | 175 | | |
| 176 | + | |
164 | 177 | | |
165 | 178 | | |
166 | 179 | | |
| |||
185 | 198 | | |
186 | 199 | | |
187 | 200 | | |
188 | | - | |
| 201 | + | |
189 | 202 | | |
190 | 203 | | |
191 | 204 | | |
192 | 205 | | |
193 | | - | |
| 206 | + | |
194 | 207 | | |
195 | 208 | | |
196 | | - | |
| 209 | + | |
197 | 210 | | |
198 | 211 | | |
199 | | - | |
200 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
201 | 215 | | |
202 | 216 | | |
203 | 217 | | |
204 | 218 | | |
205 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
206 | 223 | | |
207 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
208 | 234 | | |
209 | 235 | | |
210 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
211 | 242 | | |
212 | 243 | | |
213 | 244 | | |
| |||
271 | 302 | | |
272 | 303 | | |
273 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
274 | 314 | | |
275 | 315 | | |
276 | 316 | | |
| |||
320 | 360 | | |
321 | 361 | | |
322 | 362 | | |
| 363 | + | |
323 | 364 | | |
324 | 365 | | |
325 | 366 | | |
| |||
367 | 408 | | |
368 | 409 | | |
369 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
370 | 417 | | |
371 | 418 | | |
372 | 419 | | |
| |||
397 | 444 | | |
398 | 445 | | |
399 | 446 | | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
400 | 450 | | |
401 | 451 | | |
402 | 452 | | |
| |||
427 | 477 | | |
428 | 478 | | |
429 | 479 | | |
430 | | - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
431 | 486 | | |
432 | 487 | | |
433 | 488 | | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
434 | 492 | | |
435 | 493 | | |
436 | 494 | | |
437 | 495 | | |
438 | 496 | | |
439 | | - | |
| 497 | + | |
440 | 498 | | |
441 | 499 | | |
442 | 500 | | |
| |||
449 | 507 | | |
450 | 508 | | |
451 | 509 | | |
452 | | - | |
| 510 | + | |
453 | 511 | | |
454 | 512 | | |
455 | 513 | | |
| |||
476 | 534 | | |
477 | 535 | | |
478 | 536 | | |
479 | | - | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
480 | 554 | | |
481 | 555 | | |
482 | 556 | | |
| |||
516 | 590 | | |
517 | 591 | | |
518 | 592 | | |
| 593 | + | |
519 | 594 | | |
520 | 595 | | |
521 | 596 | | |
522 | 597 | | |
523 | 598 | | |
524 | 599 | | |
| 600 | + | |
525 | 601 | | |
526 | 602 | | |
527 | 603 | | |
| |||
596 | 672 | | |
597 | 673 | | |
598 | 674 | | |
| 675 | + | |
| 676 | + | |
599 | 677 | | |
600 | 678 | | |
601 | 679 | | |
| |||
624 | 702 | | |
625 | 703 | | |
626 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
627 | 714 | | |
628 | 715 | | |
629 | 716 | | |
| |||
632 | 719 | | |
633 | 720 | | |
634 | 721 | | |
| 722 | + | |
635 | 723 | | |
636 | 724 | | |
637 | 725 | | |
| |||
660 | 748 | | |
661 | 749 | | |
662 | 750 | | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
663 | 757 | | |
664 | 758 | | |
665 | 759 | | |
| |||
822 | 916 | | |
823 | 917 | | |
824 | 918 | | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
825 | 936 | | |
826 | 937 | | |
827 | 938 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
353 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
354 | 358 | | |
355 | 359 | | |
356 | 360 | | |
| |||
0 commit comments