@@ -27,6 +27,7 @@ fn cargo_metadata_simple() {
27
27
"edition": "2015",
28
28
"license": null,
29
29
"license_file": null,
30
+ "links": null,
30
31
"description": null,
31
32
"readme": null,
32
33
"repository": null,
@@ -116,6 +117,7 @@ crate-type = ["lib", "staticlib"]
116
117
"edition": "2015",
117
118
"license": null,
118
119
"license_file": null,
120
+ "links": null,
119
121
"description": null,
120
122
"targets": [
121
123
{
@@ -195,6 +197,7 @@ optional_feat = []
195
197
"edition": "2015",
196
198
"license": null,
197
199
"license_file": null,
200
+ "links": null,
198
201
"description": null,
199
202
"targets": [
200
203
{
@@ -287,6 +290,7 @@ fn cargo_metadata_with_deps_and_version() {
287
290
"keywords": [],
288
291
"license": null,
289
292
"license_file": null,
293
+ "links": null,
290
294
"manifest_path": "[..]Cargo.toml",
291
295
"metadata": null,
292
296
"name": "baz",
@@ -342,6 +346,7 @@ fn cargo_metadata_with_deps_and_version() {
342
346
"keywords": [],
343
347
"license": "MIT",
344
348
"license_file": null,
349
+ "links": null,
345
350
"manifest_path": "[..]Cargo.toml",
346
351
"metadata": null,
347
352
"name": "foo",
@@ -374,6 +379,7 @@ fn cargo_metadata_with_deps_and_version() {
374
379
"keywords": [],
375
380
"license": null,
376
381
"license_file": null,
382
+ "links": null,
377
383
"manifest_path": "[..]Cargo.toml",
378
384
"metadata": null,
379
385
"name": "foobar",
@@ -418,6 +424,7 @@ fn cargo_metadata_with_deps_and_version() {
418
424
"keywords": [],
419
425
"license": null,
420
426
"license_file": null,
427
+ "links": null,
421
428
"manifest_path": "[..]Cargo.toml",
422
429
"metadata": null,
423
430
"name": "bar",
@@ -533,6 +540,7 @@ name = "ex"
533
540
"keywords": [],
534
541
"license": null,
535
542
"license_file": null,
543
+ "links": null,
536
544
"description": null,
537
545
"edition": "2015",
538
546
"source": null,
@@ -615,6 +623,7 @@ crate-type = ["rlib", "dylib"]
615
623
"keywords": [],
616
624
"license": null,
617
625
"license_file": null,
626
+ "links": null,
618
627
"description": null,
619
628
"edition": "2015",
620
629
"source": null,
@@ -698,6 +707,7 @@ fn workspace_metadata() {
698
707
"dependencies": [],
699
708
"license": null,
700
709
"license_file": null,
710
+ "links": null,
701
711
"description": null,
702
712
"edition": "2015",
703
713
"targets": [
@@ -728,6 +738,7 @@ fn workspace_metadata() {
728
738
"dependencies": [],
729
739
"license": null,
730
740
"license_file": null,
741
+ "links": null,
731
742
"description": null,
732
743
"edition": "2015",
733
744
"targets": [
@@ -806,6 +817,7 @@ fn workspace_metadata_no_deps() {
806
817
"dependencies": [],
807
818
"license": null,
808
819
"license_file": null,
820
+ "links": null,
809
821
"description": null,
810
822
"edition": "2015",
811
823
"targets": [
@@ -836,6 +848,7 @@ fn workspace_metadata_no_deps() {
836
848
"dependencies": [],
837
849
"license": null,
838
850
"license_file": null,
851
+ "links": null,
839
852
"description": null,
840
853
"edition": "2015",
841
854
"targets": [
@@ -893,6 +906,7 @@ const MANIFEST_OUTPUT: &str = r#"
893
906
"keywords": [],
894
907
"license": null,
895
908
"license_file": null,
909
+ "links": null,
896
910
"description": null,
897
911
"edition": "2015",
898
912
"targets":[{
@@ -1070,6 +1084,7 @@ fn package_metadata() {
1070
1084
"edition": "2015",
1071
1085
"license": null,
1072
1086
"license_file": null,
1087
+ "links": null,
1073
1088
"description": null,
1074
1089
"targets": [
1075
1090
{
@@ -1137,6 +1152,7 @@ fn cargo_metadata_path_to_cargo_toml_project() {
1137
1152
"keywords": [],
1138
1153
"license": null,
1139
1154
"license_file": null,
1155
+ "links": null,
1140
1156
"manifest_path": "[..]Cargo.toml",
1141
1157
"metadata": null,
1142
1158
"name": "bar",
@@ -1218,6 +1234,7 @@ fn package_edition_2018() {
1218
1234
"keywords": [],
1219
1235
"license": null,
1220
1236
"license_file": null,
1237
+ "links": null,
1221
1238
"manifest_path": "[..]Cargo.toml",
1222
1239
"metadata": null,
1223
1240
"name": "foo",
@@ -1303,6 +1320,7 @@ fn target_edition_2018() {
1303
1320
"keywords": [],
1304
1321
"license": null,
1305
1322
"license_file": null,
1323
+ "links": null,
1306
1324
"manifest_path": "[..]Cargo.toml",
1307
1325
"metadata": null,
1308
1326
"name": "foo",
@@ -1423,6 +1441,7 @@ fn rename_dependency() {
1423
1441
"keywords": [],
1424
1442
"license": null,
1425
1443
"license_file": null,
1444
+ "links": null,
1426
1445
"manifest_path": "[..]",
1427
1446
"metadata": null,
1428
1447
"name": "foo",
@@ -1455,6 +1474,7 @@ fn rename_dependency() {
1455
1474
"keywords": [],
1456
1475
"license": null,
1457
1476
"license_file": null,
1477
+ "links": null,
1458
1478
"manifest_path": "[..]",
1459
1479
"metadata": null,
1460
1480
"name": "bar",
@@ -1487,6 +1507,7 @@ fn rename_dependency() {
1487
1507
"keywords": [],
1488
1508
"license": null,
1489
1509
"license_file": null,
1510
+ "links": null,
1490
1511
"manifest_path": "[..]",
1491
1512
"metadata": null,
1492
1513
"name": "bar",
@@ -1554,3 +1575,90 @@ fn rename_dependency() {
1554
1575
)
1555
1576
. run ( ) ;
1556
1577
}
1578
+
1579
+ #[ test]
1580
+ fn metadata_links ( ) {
1581
+ let p = project ( )
1582
+ . file (
1583
+ "Cargo.toml" ,
1584
+ r#"
1585
+ [project]
1586
+ name = "foo"
1587
+ version = "0.5.0"
1588
+ links = "a"
1589
+ "# ,
1590
+ )
1591
+ . file ( "src/lib.rs" , "" )
1592
+ . file ( "build.rs" , "fn main() {}" )
1593
+ . build ( ) ;
1594
+
1595
+ p. cargo ( "metadata" )
1596
+ . with_json ( r#"
1597
+ {
1598
+ "packages": [
1599
+ {
1600
+ "authors": [],
1601
+ "categories": [],
1602
+ "dependencies": [],
1603
+ "description": null,
1604
+ "edition": "2015",
1605
+ "features": {},
1606
+ "id": "foo 0.5.0 [..]",
1607
+ "keywords": [],
1608
+ "license": null,
1609
+ "license_file": null,
1610
+ "links": "a",
1611
+ "manifest_path": "[..]/foo/Cargo.toml",
1612
+ "metadata": null,
1613
+ "name": "foo",
1614
+ "readme": null,
1615
+ "repository": null,
1616
+ "source": null,
1617
+ "targets": [
1618
+ {
1619
+ "crate_types": [
1620
+ "lib"
1621
+ ],
1622
+ "edition": "2015",
1623
+ "kind": [
1624
+ "lib"
1625
+ ],
1626
+ "name": "foo",
1627
+ "src_path": "[..]/foo/src/lib.rs"
1628
+ },
1629
+ {
1630
+ "crate_types": [
1631
+ "bin"
1632
+ ],
1633
+ "edition": "2015",
1634
+ "kind": [
1635
+ "custom-build"
1636
+ ],
1637
+ "name": "build-script-build",
1638
+ "src_path": "[..]/foo/build.rs"
1639
+ }
1640
+ ],
1641
+ "version": "0.5.0"
1642
+ }
1643
+ ],
1644
+ "resolve": {
1645
+ "nodes": [
1646
+ {
1647
+ "dependencies": [],
1648
+ "deps": [],
1649
+ "features": [],
1650
+ "id": "foo 0.5.0 [..]"
1651
+ }
1652
+ ],
1653
+ "root": "foo 0.5.0 [..]"
1654
+ },
1655
+ "target_directory": "[..]/foo/target",
1656
+ "version": 1,
1657
+ "workspace_members": [
1658
+ "foo 0.5.0 [..]"
1659
+ ],
1660
+ "workspace_root": "[..]/foo"
1661
+ }
1662
+ "# )
1663
+ . run ( )
1664
+ }
0 commit comments