Skip to content

Commit 2289026

Browse files
committed
docs(ref): Move default-members defalting to default-members
This also tweaks the wording to be clear that `default-members` always apply in the workspace root, not just for virtual workspaces.
1 parent 58415ff commit 2289026

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/doc/src/reference/workspaces.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,8 @@ is not inside a subdirectory of the workspace root.
120120
In a workspace, package-related Cargo commands like [`cargo build`] can use
121121
the `-p` / `--package` or `--workspace` command-line flags to determine which
122122
packages to operate on. If neither of those flags are specified, Cargo will
123-
use the package in the current working directory. If the current directory is
124-
a [virtual workspace](#virtual-workspace), it will apply to all members (as if
125-
`--workspace` were specified on the command-line). See also
126-
[`default-members`](#the-default-members-field).
123+
use the package in the current working directory. However, if the current directory is
124+
a workspace root, the [`default-members`](#the-default-members-field) will be used.
127125

128126
## The `default-members` field
129127

@@ -137,6 +135,10 @@ members = ["path/to/member1", "path/to/member2", "path/to/member3/*"]
137135
default-members = ["path/to/member2", "path/to/member3/foo"]
138136
```
139137

138+
When unspecified, the [root package](#root-package) will be used.
139+
In the case of a [virtual workspace](#virtual-workspace), all members will be used
140+
(as if `--workspace` were specified on the command-line).
141+
140142
## The `package` table
141143

142144
The `workspace.package` table is where you define keys that can be

0 commit comments

Comments
 (0)