Cargo: Document how to conditionally enable features in dependencies

Created on 7 Mar 2018  ·  3Comments  ·  Source: rust-lang/cargo

The / syntax in the features section appears to be undocumented.

A-documenting-cargo-itself

Most helpful comment

for anyone else coming here googling:

[dependencies]
othercrate = "1.2.3"

[features]
myfeature = ["othercrate/otherfeature"]

All 3 comments

for anyone else coming here googling:

[dependencies]
othercrate = "1.2.3"

[features]
myfeature = ["othercrate/otherfeature"]

Is it? The [features] section in the manifest reference docs (link) has the example:

# Features can be used to reexport features of other packages. The `session`
# feature of package `awesome` will ensure that the `session` feature of the
# package `cookie` is also enabled.
session = ["cookie/session"]

(which has been there since the feature's inception in #712)

Optimistically closing that this was just missed (I think mdbook search wasn't around in March). If this still needs work we can reopen.

How does this work if cookie is optional?

Was this page helpful?
0 / 5 - 0 ratings