@@ -39,16 +39,15 @@ To create a workspace, you add the `[workspace]` table to a `Cargo.toml`:
39
39
# ...
40
40
```
41
41
42
- The directory where the workspace's Cargo.toml is located then becomes so-called the workspace root.
43
-
44
42
At minimum, a workspace has to have a member, either with a root package or as
45
43
a virtual manifest.
46
44
47
45
### Root package
48
46
49
47
If the [ ` [workspace] ` section] ( #the-workspace-section ) is added to a
50
48
` Cargo.toml ` that already defines a ` [package] ` , the package is
51
- the * root package* of the workspace.
49
+ the * root package* of the workspace. The * workspace root* is the directory
50
+ where the workspace's ` Cargo.toml ` is located.
52
51
53
52
Example:
54
53
``` toml
@@ -60,12 +59,13 @@ version = "0.1.0" # the current version, obeying semver
60
59
61
60
```
62
61
63
- Under [ workspace ] ( #the-workspace-section ) , you can specify which members the workspace has through
64
- [ workspace.members filed] ( #the-members-and-exclude-fields ) .
62
+ In the [ worksapce section ] ( #the-workspace-section ) , you can specify the members of
63
+ the workspace by [ workspace.members filed] ( #the-members-and-exclude-fields ) .
65
64
66
65
If no other members are specified in [ workspace.members filed] ( #the-members-and-exclude-fields )
67
66
in ` Cargo.toml ` in the workspace root directory, the root package will
68
- become the default workspace member.
67
+ become the default workspace member. In addition, you can also specify the default
68
+ workspace members through [ workspace.default-members] ( #the-default-members-field ) .
69
69
70
70
### Virtual workspace
71
71
@@ -90,6 +90,10 @@ edition = "2021" # the edition, will have no effect on a resolver used in th
90
90
91
91
```
92
92
93
+ In a virtual workspace, at least one member needed be included and if
94
+ [ workspace.default-member] ( #the-default-members-field ) is empty, all members of
95
+ the workspace are default members.
96
+
93
97
Note that in a virtual manifest the [ ` resolver = "2" ` ] ( resolver.md#resolver-versions )
94
98
should be specified manually. It is usually deduced from the [ ` package.edition ` ] [ package-edition ]
95
99
field which is absent in virtual manifests and the edition field of a member
0 commit comments