diff --git a/Cargo.toml b/Cargo.toml index b24b8ff3..ced60102 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,6 +34,7 @@ include = [ [package.metadata.docs.rs] features = ["unstable-doc"] +rustc-args = ["--cfg", "docsrs"] cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples=examples"] [package.metadata.playground] diff --git a/src/lib.rs b/src/lib.rs index 4d6a1e9d..7ae9e9af 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,6 +3,7 @@ // (see LICENSE or ) All files in the project carrying such // notice may not be copied, modified, or distributed except according to those terms. +#![cfg_attr(feature = "docsrs", feature(doc_auto_cfg))] #![doc(html_logo_url = "https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png")] #![cfg_attr(feature = "derive", doc = include_str!("../README.md"))] //!