From 96a5d5b28d8dc6d03f7b647b6aadd5c7de56e3be Mon Sep 17 00:00:00 2001 From: tottoto Date: Fri, 17 Oct 2025 00:21:42 +0900 Subject: [PATCH 1/2] chore(doc): Replace doc_auto_cfg config with doc_cfg --- tonic-build/src/lib.rs | 2 +- tonic-health/src/lib.rs | 2 +- tonic-reflection/src/lib.rs | 2 +- tonic/src/lib.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tonic-build/src/lib.rs b/tonic-build/src/lib.rs index 574fc05e4..e03ec917d 100644 --- a/tonic-build/src/lib.rs +++ b/tonic-build/src/lib.rs @@ -5,7 +5,7 @@ )] #![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")] #![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(docsrs, feature(doc_cfg))] use proc_macro2::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream}; use quote::TokenStreamExt; diff --git a/tonic-health/src/lib.rs b/tonic-health/src/lib.rs index 5884fd82d..07304646b 100644 --- a/tonic-health/src/lib.rs +++ b/tonic-health/src/lib.rs @@ -11,7 +11,7 @@ )] #![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")] #![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(docsrs, feature(doc_cfg))] use std::fmt::{Display, Formatter}; diff --git a/tonic-reflection/src/lib.rs b/tonic-reflection/src/lib.rs index 97ea31653..1372a2d0f 100644 --- a/tonic-reflection/src/lib.rs +++ b/tonic-reflection/src/lib.rs @@ -5,7 +5,7 @@ )] #![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")] #![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(docsrs, feature(doc_cfg))] mod generated { #![allow(unreachable_pub)] diff --git a/tonic/src/lib.rs b/tonic/src/lib.rs index bfd2f8bd5..86938103f 100644 --- a/tonic/src/lib.rs +++ b/tonic/src/lib.rs @@ -97,7 +97,7 @@ )] #![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")] #![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(docsrs, feature(doc_cfg))] pub mod body; pub mod client; From 9e1e59aa47a26e24062a0c7bbd927da3709775c4 Mon Sep 17 00:00:00 2001 From: tottoto Date: Sat, 25 Oct 2025 18:27:50 +0900 Subject: [PATCH 2/2] chore(ci): Use cargo-docs-rs to make docs check with the same options that would be used by docs.rs --- .github/workflows/CI.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ff3669706..bf9ffa887 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -308,7 +308,16 @@ jobs: - uses: Swatinem/rust-cache@v2 # we exlude crates that do not use rust-version = { workspace = true } - run: cargo no-dev-deps --no-private check --all-features --workspace --exclude grpc --exclude tonic-protobuf\* - - run: cargo no-dev-deps --no-private doc --no-deps --all-features --workspace --exclude grpc --exclude tonic-protobuf\* + + doc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: dtolnay/rust-toolchain@nightly + - uses: dtolnay/install@cargo-docs-rs + - uses: taiki-e/install-action@cargo-hack + - uses: Swatinem/rust-cache@v2 + - run: cargo +nightly hack --no-private docs-rs env: RUSTDOCFLAGS: "-D warnings"