3
3
- RFC PR: [ rust-lang/rfcs #2906 ] ( https://github.com/rust-lang/rfcs/pull/2906 )
4
4
- Rust Issue: [ rust-lang/cargo #8415 ] ( https://github.com/rust-lang/cargo/issues/8415 )
5
5
6
+ > ** Note** : This feature was stabilized in Rust 1.64. Several design changes were made in the course of the implementation. Please see the documentation for [ ` [workspace.package] ` ] ( https://doc.rust-lang.org/nightly/cargo/reference/workspaces.html#the-package-table ) and [ ` [workspace.dependencies] ` ] ( https://doc.rust-lang.org/nightly/cargo/reference/workspaces.html#the-dependencies-table ) for details on how to use this feature.
7
+
6
8
# Summary
7
9
[ summary ] : #summary
8
10
@@ -180,10 +182,10 @@ version = { workspace = true }
180
182
This directive tells Cargo that the version of ` foo ` is the same as the
181
183
` workspace.version ` directive found in the workspace manifest. This means that
182
184
in addition to a new ` [workspace.dependencies] ` section, package metadata keys
183
- can now also be defined inside of a ` [workspace.package ] ` section:
185
+ can now also be defined inside of a ` [workspace] ` section:
184
186
185
187
``` toml
186
- [workspace . package ]
188
+ [workspace ]
187
189
version = " 0.25.2"
188
190
```
189
191
@@ -233,11 +235,11 @@ Dependencies declared in `[workspace.dependencies]` have no meaning as-is. They
233
235
do not affect the build nor do they force packages to depend on those
234
236
dependencies. This part comes later below.
235
237
236
- The ` [workspace.package ] ` section will also allow the definition of a number of keys
238
+ The ` [workspace] ` section will also allow the definition of a number of keys
237
239
also defined in ` [package] ` today, namely:
238
240
239
241
``` toml
240
- [workspace . package ]
242
+ [workspace ]
241
243
version = " 1.2.3"
242
244
authors = [" Nice Folks" ]
243
245
description = " ..."
@@ -252,11 +254,11 @@ categories = ["development-tools"]
252
254
publish = false
253
255
edition = " 2018"
254
256
255
- [workspace .package . badges ]
257
+ [workspace .badges ]
256
258
# ...
257
259
```
258
260
259
- Each of these keys have no meaning in a ` [workspace.package ] ` table yet, but will have
261
+ Each of these keys have no meaning in a ` [workspace] ` table yet, but will have
260
262
meaning when they're assigned to crates internally. That part comes later though
261
263
in this design! Note that the format and accepted values for these keys are the
262
264
same as the ` [package] ` section of ` Cargo.toml ` .
@@ -294,7 +296,7 @@ This directive indicates that the license of `foo` is the same as
294
296
` workspace.license ` . If ` workspace.license ` isn't defined then this generates an
295
297
error.
296
298
297
- The following keys in ` [package] ` can be inherited from ` [workspace.package ] ` with the
299
+ The following keys in ` [package] ` can be inherited from ` [workspace] ` with the
298
300
new ` workspace = true ` directive.
299
301
300
302
``` toml
@@ -589,7 +591,7 @@ ways this could happen.
589
591
## Inheriting metadata from other packages
590
592
591
593
One possible extension of this RFC is for metadata to not only be inheritable
592
- from the ` [workspace.package ] ` table but also from other packages. For example a
594
+ from the ` [workspace] ` table but also from other packages. For example a
593
595
scenario seen in the wild is that some repositories have multiple "cliques" of
594
596
crates which are all versioned as a unit. In this scenario one "clique" can have
595
597
its version directives deduplicated with this proposal, but not multiple ones.
0 commit comments