From 1c0c8ed5295583d16e40533062a37346e414fdcb Mon Sep 17 00:00:00 2001 From: Serge Barral Date: Sun, 8 Sep 2024 17:31:39 +0200 Subject: [PATCH] Add automatic feature documentation for docs.rs --- .github/workflows/ci.yml | 2 ++ asynchronix/Cargo.toml | 4 ++++ asynchronix/src/lib.rs | 2 ++ 3 files changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1c0f5d..9c9f013 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -163,3 +163,5 @@ jobs: - name: Run cargo doc run: cargo doc --no-deps --all-features --document-private-items + env: + RUSTDOCFLAGS: --cfg docsrs -Dwarnings diff --git a/asynchronix/Cargo.toml b/asynchronix/Cargo.toml index a9f0856..e58a520 100644 --- a/asynchronix/Cargo.toml +++ b/asynchronix/Cargo.toml @@ -71,6 +71,10 @@ tonic-build = { version = "0.12" } # `asynchronix_grpc_codegen` flag: regenerate gRPC code from .proto definitions. unexpected_cfgs = { level = "warn", check-cfg = ['cfg(asynchronix_loom)', 'cfg(asynchronix_grpc_codegen)'] } +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [[test]] name = "integration" path = "tests/tests.rs" diff --git a/asynchronix/src/lib.rs b/asynchronix/src/lib.rs index ffa8139..10333cb 100644 --- a/asynchronix/src/lib.rs +++ b/asynchronix/src/lib.rs @@ -406,6 +406,8 @@ //! * the [`time`] module discusses in particular the monotonic timestamp format //! used for simulations ([`time::MonotonicTime`]). #![warn(missing_docs, missing_debug_implementations, unreachable_pub)] +#![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg_hide))] +#![cfg_attr(docsrs, doc(cfg_hide(feature = "dev-hooks")))] pub(crate) mod channel; pub(crate) mod executor;