@@ -202,29 +202,12 @@ enabled:
202
202
` package-name/feature-name ` syntax can be used to specify features for
203
203
specific workspace members.
204
204
205
- > ** Note** : With the ` resolver = "1" ` option [ described
206
- > below] ( #feature-resolver-version-2 ) , the features chosen are for the
207
- > package in the current directory, not the packages selected with the ` -p `
208
- > flags. With the ` resolver = "2" ` , it will instead enable the listed
209
- > features for the packages listed in the ` -p ` flags.
210
- >
211
- > For example, when ` resolver = "2" ` is enabled:
212
- >
213
- > cargo build -p member1 -p member2 --features foo,bar
214
- >
215
- > In this situation, features "foo" and "bar" are enabled on the given
216
- > members only if the member defines that feature. It is an error if none of
217
- > the selected packages defines a given feature.
218
-
219
205
* ` --all-features ` : Activates all features of all packages selected on the
220
206
command-line.
221
207
222
208
* ` --no-default-features ` : Does not activate the [ ` default `
223
209
feature] ( #the-default-feature ) of the selected packages.
224
210
225
- > ** Note** : With the ` resolver = "1" ` option, this only applies to the
226
- > package in the current directory.
227
-
228
211
[ workspace ] : workspaces.md
229
212
230
213
### Feature unification
@@ -248,10 +231,6 @@ another dependency `bar` which enables the "std" and "winnt" features of
248
231
[ `winapi` ] : https://crates.io/crates/winapi
249
232
[ winapi-features ] : https://github.com/retep998/winapi-rs/blob/0.3.9/Cargo.toml#L25-L431
250
233
251
- > ** Note** : Sometimes feature unification may be a little too aggressive. See
252
- > the ` resolver = "2" ` option [ described below] ( #feature-resolver-version-2 )
253
- > for improved behavior.
254
-
255
234
A consequence of this is that features should be * additive* . That is, enabling
256
235
a feature should not disable functionality, and it should usually be safe to
257
236
enable any combination of features. A feature should not introduce a
@@ -379,6 +358,10 @@ the command-line with `-p` flags. For example:
379
358
cargo build -p foo -p bar --features foo-feat,bar-feat
380
359
```
381
360
361
+ Additionally, with ` resolver = "1" ` , the ` --no-default-features ` flag only
362
+ disables the default feature for the package in the current directory. With
363
+ version "2", it will disable the default features for all workspace members.
364
+
382
365
The resolver is a global option that affects the entire workspace. The
383
366
` resolver ` version in dependencies is ignored, only the value in the top-level
384
367
package will be used. If using a [ virtual workspace] , the version should be
0 commit comments