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

Related issues

japaric picture japaric  路  3Comments

briansmith picture briansmith  路  3Comments

fprijate picture fprijate  路  3Comments

SimonSapin picture SimonSapin  路  3Comments

shepmaster picture shepmaster  路  3Comments