doc-cfg
The #[doc_cfg(..)]
attribute is a convenience that removes the boilerplate
involved with using #[doc(cfg(..))]
in stable crates.
Usage
Add the following to Cargo.toml
to get started:
[]
= { = "0.1" }
[]
= []
[]
= ["unstable-doc-cfg"]
In your crate, use #[doc_cfg(..)]
where you'd normally use #[cfg(..)]
:
use 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,
#[doc_cfg(..)]
is otherwise identical to #[cfg(..)]
when built without it.
Documentation
See the documentation and example for up to date usage information.