From d42cfee912789f0fc952ef92c4cc2ccb2831aa85 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 8 Dec 2021 20:32:40 -0600 Subject: [PATCH] docs: Auto-tag feature flags Fixes #3095 --- Cargo.toml | 1 + src/lib.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index b24b8ff3de9..ced60102dde 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 4d6a1e9d51d..7ae9e9af309 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"))] //!