@@ -1202,6 +1202,68 @@ For instance:
1202
1202
cargo check -Z unstable-options -Z check-cfg-features
1203
1203
```
1204
1204
1205
+ ### workspace-inheritance
1206
+
1207
+ * RFC: [ #2906 ] ( https://github.com/rust-lang/rfcs/blob/master/text/2906-cargo-workspace-deduplicate.md )
1208
+ * Tracking Issue: [ #8415 ] ( https://github.com/rust-lang/cargo/issues/8415 )
1209
+
1210
+ The ` workspace-inheritance ` feature allows workspace members to inherit fields
1211
+ and dependencies from a workspace.
1212
+
1213
+ Example 1:
1214
+
1215
+ ``` toml
1216
+ # in workspace's Cargo.toml
1217
+ [workspace .dependencies ]
1218
+ log = " 0.3.1"
1219
+ log2 = { version = " 2.0.0" , package = " log" }
1220
+ serde = { git = ' https://github.com/serde-rs/serde' }
1221
+ wasm-bindgen-cli = { path = " crates/cli" }
1222
+ ```
1223
+
1224
+ ``` toml
1225
+ # in a workspace member's Cargo.toml
1226
+ [dependencies ]
1227
+ log.workspace = true
1228
+ log2.workspace = true
1229
+ ```
1230
+
1231
+ Example 2:
1232
+ ``` toml
1233
+ # in workspace's Cargo.toml
1234
+ [workspace .package ]
1235
+ version = " 1.2.3"
1236
+ authors = [" Nice Folks" ]
1237
+ description = " ..."
1238
+ documentation = " https://example.github.io/example"
1239
+ readme = " README.md"
1240
+ homepage = " https://example.com"
1241
+ repository = " https://github.com/example/example"
1242
+ license = " MIT"
1243
+ license-file = " ./LICENSE"
1244
+ keywords = [" cli" ]
1245
+ categories = [" development-tools" ]
1246
+ publish = false
1247
+ edition = " 2018"
1248
+ ```
1249
+
1250
+ ``` toml
1251
+ # in a workspace member's Cargo.toml
1252
+ [package ]
1253
+ version.workspace = true
1254
+ authors.workspace = true
1255
+ description.workspace = true
1256
+ documentation.workspace = true
1257
+ readme.workspace = true
1258
+ homepage.workspace = true
1259
+ repository.workspace = true
1260
+ license.workspace = true
1261
+ license-file.workspace = true
1262
+ keywords.workspace = true
1263
+ categories.workspace = true
1264
+ publish.workspace = true
1265
+ ```
1266
+
1205
1267
## Stabilized and removed features
1206
1268
1207
1269
### Compile progress
@@ -1382,66 +1444,4 @@ See the [Features chapter](features.md#dependency-features) for more information
1382
1444
1383
1445
The ` -Ztimings ` option has been stabilized as ` --timings ` in the 1.60 release.
1384
1446
(` --timings=html ` and the machine-readable ` --timings=json ` output remain
1385
- unstable and require ` -Zunstable-options ` .)
1386
-
1387
- ### workspace-inheritance
1388
-
1389
- * RFC: [ #2906 ] ( https://github.com/rust-lang/rfcs/blob/master/text/2906-cargo-workspace-deduplicate.md )
1390
- * Tracking Issue: [ #8415 ] ( https://github.com/rust-lang/cargo/issues/8415 )
1391
-
1392
- The ` workspace-inheritance ` feature allows workspace members to inherit fields
1393
- and dependencies from a workspace.
1394
-
1395
- Example 1:
1396
-
1397
- ``` toml
1398
- # in workspace's Cargo.toml
1399
- [workspace .dependencies ]
1400
- log = " 0.3.1"
1401
- log2 = { version = " 2.0.0" , package = " log" }
1402
- serde = { git = ' https://github.com/serde-rs/serde' }
1403
- wasm-bindgen-cli = { path = " crates/cli" }
1404
- ```
1405
-
1406
- ``` toml
1407
- # in a workspace member's Cargo.toml
1408
- [dependencies ]
1409
- log = { workspace = true }
1410
- log2 = { workspace = true }
1411
- ```
1412
-
1413
- Example 2:
1414
- ``` toml
1415
- # in workspace's Cargo.toml
1416
- [workspace ]
1417
- version = " 1.2.3"
1418
- authors = [" Nice Folks" ]
1419
- description = " ..."
1420
- documentation = " https://example.github.io/example"
1421
- readme = " README.md"
1422
- homepage = " https://example.com"
1423
- repository = " https://github.com/example/example"
1424
- license = " MIT"
1425
- license-file = " ./LICENSE"
1426
- keywords = [" cli" ]
1427
- categories = [" development-tools" ]
1428
- publish = false
1429
- edition = " 2018"
1430
- ```
1431
-
1432
- ``` toml
1433
- # in a workspace member's Cargo.toml
1434
- [package ]
1435
- version = { workspace = true }
1436
- authors = { workspace = true }
1437
- description = { workspace = true }
1438
- documentation = { workspace = true }
1439
- readme = { workspace = true }
1440
- homepage = { workspace = true }
1441
- repository = { workspace = true }
1442
- license = { workspace = true }
1443
- license-file = { workspace = true }
1444
- keywords = { workspace = true }
1445
- categories = { workspace = true }
1446
- publish = { workspace = true }
1447
- ```
1447
+ unstable and require ` -Zunstable-options ` .)
0 commit comments