Skip to content

Commit ca89faf

Browse files
committed
move the guideline under virtual manifest section
1 parent fc200e4 commit ca89faf

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/doc/src/reference/workspaces.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ To create a workspace, you add the `[workspace]` table to a `Cargo.toml`:
3939

4040
At minimum, a workspace has to have a member, either with a root package or as
4141
a virtual manifest.
42-
It's also a good practice to specify the `resolver = "2"` unless it is necessary
43-
to rely on the old one. It is a default resolver for all packages in the `2021` edition
44-
but it has to be explicitely set under the workspace.
4542

4643
#### Root package
4744

@@ -79,9 +76,15 @@ resolver = "2"
7976
[package]
8077
name = "hello_world" # the name of the package
8178
version = "0.1.0" # the current version, obeying semver
79+
edition = "2021" # the edition, will have no effect on a resolver used in the workspace
8280
authors = ["Alice <a@example.com>", "Bob <b@example.com>"]
8381
```
8482

83+
Note that in a virtual manifest the [`resolver = "2"`](resolver.md#resolver-versions)
84+
should be specified manually. It is usually deduced from the [`package.edition`][package-edition]
85+
field which is absent in virtual manifests and the edition field of a member
86+
won't affect the resolver used by the workspace.
87+
8588
### The `members` and `exclude` fields
8689

8790
The `members` and `exclude` fields define which packages are members of
@@ -251,6 +254,7 @@ if that makes sense for the tool in question.
251254
[package]: manifest.md#the-package-section
252255
[`Cargo.lock`]: ../guide/cargo-toml-vs-cargo-lock.md
253256
[package-metadata]: manifest.md#the-metadata-table
257+
[package-edition]: manifest.md#the-edition-field
254258
[output directory]: ../guide/build-cache.md
255259
[patch]: overriding-dependencies.md#the-patch-section
256260
[replace]: overriding-dependencies.md#the-replace-section

0 commit comments

Comments
 (0)