@@ -39,9 +39,6 @@ To create a workspace, you add the `[workspace]` table to a `Cargo.toml`:
39
39
40
40
At minimum, a workspace has to have a member, either with a root package or as
41
41
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.
45
42
46
43
#### Root package
47
44
@@ -79,9 +76,15 @@ resolver = "2"
79
76
[package ]
80
77
name = " hello_world" # the name of the package
81
78
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
82
80
authors = [" Alice <a@example.com>" , " Bob <b@example.com>" ]
83
81
```
84
82
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
+
85
88
### The ` members ` and ` exclude ` fields
86
89
87
90
The ` members ` and ` exclude ` fields define which packages are members of
@@ -251,6 +254,7 @@ if that makes sense for the tool in question.
251
254
[ package ] : manifest.md#the-package-section
252
255
[ `Cargo.lock` ] : ../guide/cargo-toml-vs-cargo-lock.md
253
256
[ package-metadata ] : manifest.md#the-metadata-table
257
+ [ package-edition ] : manifest.md#the-edition-field
254
258
[ output directory ] : ../guide/build-cache.md
255
259
[ patch ] : overriding-dependencies.md#the-patch-section
256
260
[ replace ] : overriding-dependencies.md#the-replace-section
0 commit comments