From 8a563978d26f946f0002414be9da3b12e1caf397 Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Tue, 15 Oct 2024 16:58:30 +0200 Subject: [PATCH] doc: show required features on items on docs.rs --- Cargo.toml | 4 ++++ src/lib.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 40d26f4..855ca6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,10 @@ exclude = [ "/misc", ] +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [features] # Use a spinlock internally (may be faster on some platforms) spin = [] diff --git a/src/lib.rs b/src/lib.rs index 1e11f08..73a55bc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,6 +25,7 @@ //! assert_eq!(rx.recv().unwrap(), 42); //! ``` +#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs)] #[cfg(feature = "select")]