@@ -27,6 +27,7 @@ fn cargo_metadata_simple() {
2727 "edition": "2015",
2828 "license": null,
2929 "license_file": null,
30+ "links": null,
3031 "description": null,
3132 "readme": null,
3233 "repository": null,
@@ -116,6 +117,7 @@ crate-type = ["lib", "staticlib"]
116117 "edition": "2015",
117118 "license": null,
118119 "license_file": null,
120+ "links": null,
119121 "description": null,
120122 "targets": [
121123 {
@@ -195,6 +197,7 @@ optional_feat = []
195197 "edition": "2015",
196198 "license": null,
197199 "license_file": null,
200+ "links": null,
198201 "description": null,
199202 "targets": [
200203 {
@@ -287,6 +290,7 @@ fn cargo_metadata_with_deps_and_version() {
287290 "keywords": [],
288291 "license": null,
289292 "license_file": null,
293+ "links": null,
290294 "manifest_path": "[..]Cargo.toml",
291295 "metadata": null,
292296 "name": "baz",
@@ -342,6 +346,7 @@ fn cargo_metadata_with_deps_and_version() {
342346 "keywords": [],
343347 "license": "MIT",
344348 "license_file": null,
349+ "links": null,
345350 "manifest_path": "[..]Cargo.toml",
346351 "metadata": null,
347352 "name": "foo",
@@ -374,6 +379,7 @@ fn cargo_metadata_with_deps_and_version() {
374379 "keywords": [],
375380 "license": null,
376381 "license_file": null,
382+ "links": null,
377383 "manifest_path": "[..]Cargo.toml",
378384 "metadata": null,
379385 "name": "foobar",
@@ -418,6 +424,7 @@ fn cargo_metadata_with_deps_and_version() {
418424 "keywords": [],
419425 "license": null,
420426 "license_file": null,
427+ "links": null,
421428 "manifest_path": "[..]Cargo.toml",
422429 "metadata": null,
423430 "name": "bar",
@@ -533,6 +540,7 @@ name = "ex"
533540 "keywords": [],
534541 "license": null,
535542 "license_file": null,
543+ "links": null,
536544 "description": null,
537545 "edition": "2015",
538546 "source": null,
@@ -615,6 +623,7 @@ crate-type = ["rlib", "dylib"]
615623 "keywords": [],
616624 "license": null,
617625 "license_file": null,
626+ "links": null,
618627 "description": null,
619628 "edition": "2015",
620629 "source": null,
@@ -698,6 +707,7 @@ fn workspace_metadata() {
698707 "dependencies": [],
699708 "license": null,
700709 "license_file": null,
710+ "links": null,
701711 "description": null,
702712 "edition": "2015",
703713 "targets": [
@@ -728,6 +738,7 @@ fn workspace_metadata() {
728738 "dependencies": [],
729739 "license": null,
730740 "license_file": null,
741+ "links": null,
731742 "description": null,
732743 "edition": "2015",
733744 "targets": [
@@ -806,6 +817,7 @@ fn workspace_metadata_no_deps() {
806817 "dependencies": [],
807818 "license": null,
808819 "license_file": null,
820+ "links": null,
809821 "description": null,
810822 "edition": "2015",
811823 "targets": [
@@ -836,6 +848,7 @@ fn workspace_metadata_no_deps() {
836848 "dependencies": [],
837849 "license": null,
838850 "license_file": null,
851+ "links": null,
839852 "description": null,
840853 "edition": "2015",
841854 "targets": [
@@ -893,6 +906,7 @@ const MANIFEST_OUTPUT: &str = r#"
893906 "keywords": [],
894907 "license": null,
895908 "license_file": null,
909+ "links": null,
896910 "description": null,
897911 "edition": "2015",
898912 "targets":[{
@@ -1070,6 +1084,7 @@ fn package_metadata() {
10701084 "edition": "2015",
10711085 "license": null,
10721086 "license_file": null,
1087+ "links": null,
10731088 "description": null,
10741089 "targets": [
10751090 {
@@ -1137,6 +1152,7 @@ fn cargo_metadata_path_to_cargo_toml_project() {
11371152 "keywords": [],
11381153 "license": null,
11391154 "license_file": null,
1155+ "links": null,
11401156 "manifest_path": "[..]Cargo.toml",
11411157 "metadata": null,
11421158 "name": "bar",
@@ -1218,6 +1234,7 @@ fn package_edition_2018() {
12181234 "keywords": [],
12191235 "license": null,
12201236 "license_file": null,
1237+ "links": null,
12211238 "manifest_path": "[..]Cargo.toml",
12221239 "metadata": null,
12231240 "name": "foo",
@@ -1303,6 +1320,7 @@ fn target_edition_2018() {
13031320 "keywords": [],
13041321 "license": null,
13051322 "license_file": null,
1323+ "links": null,
13061324 "manifest_path": "[..]Cargo.toml",
13071325 "metadata": null,
13081326 "name": "foo",
@@ -1423,6 +1441,7 @@ fn rename_dependency() {
14231441 "keywords": [],
14241442 "license": null,
14251443 "license_file": null,
1444+ "links": null,
14261445 "manifest_path": "[..]",
14271446 "metadata": null,
14281447 "name": "foo",
@@ -1455,6 +1474,7 @@ fn rename_dependency() {
14551474 "keywords": [],
14561475 "license": null,
14571476 "license_file": null,
1477+ "links": null,
14581478 "manifest_path": "[..]",
14591479 "metadata": null,
14601480 "name": "bar",
@@ -1487,6 +1507,7 @@ fn rename_dependency() {
14871507 "keywords": [],
14881508 "license": null,
14891509 "license_file": null,
1510+ "links": null,
14901511 "manifest_path": "[..]",
14911512 "metadata": null,
14921513 "name": "bar",
@@ -1554,3 +1575,90 @@ fn rename_dependency() {
15541575 )
15551576 . run ( ) ;
15561577}
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