Skip to content

Commit 106c2c0

Browse files
authored
Add a note about the design change of RFC 2906
1 parent 699807c commit 106c2c0

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

text/2906-cargo-workspace-deduplicate.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
- RFC PR: [rust-lang/rfcs#2906](https://github.com/rust-lang/rfcs/pull/2906)
44
- Rust Issue: [rust-lang/cargo#8415](https://github.com/rust-lang/cargo/issues/8415)
55

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+
68
# Summary
79
[summary]: #summary
810

@@ -180,10 +182,10 @@ version = { workspace = true }
180182
This directive tells Cargo that the version of `foo` is the same as the
181183
`workspace.version` directive found in the workspace manifest. This means that
182184
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:
184186

185187
```toml
186-
[workspace.package]
188+
[workspace]
187189
version = "0.25.2"
188190
```
189191

@@ -233,11 +235,11 @@ Dependencies declared in `[workspace.dependencies]` have no meaning as-is. They
233235
do not affect the build nor do they force packages to depend on those
234236
dependencies. This part comes later below.
235237

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
237239
also defined in `[package]` today, namely:
238240

239241
```toml
240-
[workspace.package]
242+
[workspace]
241243
version = "1.2.3"
242244
authors = ["Nice Folks"]
243245
description = "..."
@@ -252,11 +254,11 @@ categories = ["development-tools"]
252254
publish = false
253255
edition = "2018"
254256

255-
[workspace.package.badges]
257+
[workspace.badges]
256258
# ...
257259
```
258260

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
260262
meaning when they're assigned to crates internally. That part comes later though
261263
in this design! Note that the format and accepted values for these keys are the
262264
same as the `[package]` section of `Cargo.toml`.
@@ -294,7 +296,7 @@ This directive indicates that the license of `foo` is the same as
294296
`workspace.license`. If `workspace.license` isn't defined then this generates an
295297
error.
296298

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
298300
new `workspace = true` directive.
299301

300302
```toml
@@ -589,7 +591,7 @@ ways this could happen.
589591
## Inheriting metadata from other packages
590592

591593
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
593595
scenario seen in the wild is that some repositories have multiple "cliques" of
594596
crates which are all versioned as a unit. In this scenario one "clique" can have
595597
its version directives deduplicated with this proposal, but not multiple ones.

0 commit comments

Comments
 (0)