Skip to content

Commit aad3a1b

Browse files
committed
Add default member description in virtual workspace
1 parent fd848d1 commit aad3a1b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/doc/src/reference/workspaces.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,15 @@ To create a workspace, you add the `[workspace]` table to a `Cargo.toml`:
3939
# ...
4040
```
4141

42-
The directory where the workspace's Cargo.toml is located then becomes so-called the workspace root.
43-
4442
At minimum, a workspace has to have a member, either with a root package or as
4543
a virtual manifest.
4644

4745
### Root package
4846

4947
If the [`[workspace]` section](#the-workspace-section) is added to a
5048
`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.
5251

5352
Example:
5453
```toml
@@ -60,12 +59,13 @@ version = "0.1.0" # the current version, obeying semver
6059
authors = ["Alice <[email protected]>", "Bob <[email protected]>"]
6160
```
6261

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).
6564

6665
If no other members are specified in [workspace.members filed](#the-members-and-exclude-fields)
6766
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).
6969

7070
### Virtual workspace
7171

@@ -90,6 +90,10 @@ edition = "2021" # the edition, will have no effect on a resolver used in th
9090
authors = ["Alice <[email protected]>", "Bob <[email protected]>"]
9191
```
9292

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+
9397
Note that in a virtual manifest the [`resolver = "2"`](resolver.md#resolver-versions)
9498
should be specified manually. It is usually deduced from the [`package.edition`][package-edition]
9599
field which is absent in virtual manifests and the edition field of a member

0 commit comments

Comments
 (0)