[][src]Crate doc_cfg

The doc_cfg attribute is a convenience that removes the boilerplate involved with using #[doc(cfg(..))] in stable crates.

Add the following to Cargo.toml to get started:

doc-cfg = { version = "0.1" }

unstable-doc-cfg = []

features = ["unstable-doc-cfg"]

The name of the feature is important and should not be changed. Check out the full example for how to use it.

The unstable-doc-cfg feature should only be turned on when documenting, the #[doc_cfg(..)] attribute is otherwise identical to #[cfg(..)] when built without it.

Attribute Macros


The #[doc_cfg(..)] attribute works much like #[cfg(..)], but it allows the item being documented to show up in the crate documentation when built on a platform or configuration that doesn't match the predicate.