Skip to content

Commit 97e547b

Browse files
committed
Work around broken --cfg docsrs in other crates
By using a crate-specific `cfg(foundations_docsrs)` we avoid enabling the removed feature in our dependency crates.
1 parent e317b44 commit 97e547b

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ jobs:
4545
run: |
4646
cargo doc --lib --no-deps --all-features --document-private-items
4747
env:
48-
RUSTDOCFLAGS: --cfg docsrs -Dwarnings --cfg tokio_unstable --cfg foundations_unstable
49-
RUSTFLAGS: --cfg docsrs -Dwarnings --cfg tokio_unstable --cfg foundations_unstable
48+
RUSTDOCFLAGS: --cfg foundations_docsrs -Dwarnings --cfg tokio_unstable --cfg foundations_unstable
49+
RUSTFLAGS: --cfg foundations_docsrs -Dwarnings --cfg tokio_unstable --cfg foundations_unstable
5050

5151
# based on tokio minver cbecm
5252
minimal-versions:

foundations/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ tracing-rs-compat = ["dep:tracing-slog"]
177177

178178
[package.metadata.docs.rs]
179179
all-features = true
180-
rustdoc-args = ["--cfg", "docsrs", "--cfg", "tokio_unstable", "--cfg", "foundations_unstable", "--cfg", "foundations_generic_telemetry_wrapper"]
180+
rustdoc-args = ["--cfg", "foundations_docsrs", "--cfg", "tokio_unstable", "--cfg", "foundations_unstable", "--cfg", "foundations_generic_telemetry_wrapper"]
181181
# it's necessary to _also_ pass `--cfg tokio_unstable` and `--cfg foundations_unstable`
182182
# to rustc, or else dependencies will not be enabled, and the docs build will fail.
183183
rustc-args = ["--cfg", "tokio_unstable", "--cfg", "foundations_unstable", "--cfg", "foundations_generic_telemetry_wrapper"]

foundations/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
// NOTE: required to allow cfgs like `tokio_unstable` on nightly which is used in tests.
6969
#![allow(unexpected_cfgs)]
7070
#![warn(missing_docs)]
71-
#![cfg_attr(docsrs, feature(doc_cfg))]
71+
#![cfg_attr(foundations_docsrs, feature(doc_cfg))]
7272

7373
mod utils;
7474

foundations/src/telemetry/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub mod settings;
8181
foundations_unstable
8282
))]
8383
#[cfg_attr(
84-
docsrs,
84+
foundations_docsrs,
8585
doc(cfg(all(
8686
feature = "tokio-runtime-metrics",
8787
tokio_unstable,

0 commit comments

Comments
 (0)