From: James Bendig Date: Wed, 8 Feb 2017 21:30:24 +0000 (-0600) Subject: Added documentation for the target field `required-features`. X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~9^2~159^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4f0dc8892468f6434f95d9bfaf6f42fad92e541c;p=cargo.git Added documentation for the target field `required-features`. --- diff --git a/src/doc/manifest.md b/src/doc/manifest.md index 8ee88efe2..d6e1aa12a 100644 --- a/src/doc/manifest.md +++ b/src/doc/manifest.md @@ -551,6 +551,24 @@ proc-macro = false harness = true ``` +## The `required-features` field (optional) + +The `required-features` field specifies which features must be selected for the +target to be built. This is only relevant for the `[[bin]]`, `[[bench]]`, +`[[test]]`, and `[[example]]` sections, it has no effect on `[lib]`. + +```toml +[features] +# ... +postgres = [] +sqlite = [] +tools = [] + +[[bin]] +# ... +required-features = ["postgres", "tools"] +``` + # Building dynamic or static libraries If your project produces a library, you can specify which kind of library to