diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2d3b2a8a1a289..a253ec153de11 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -58,6 +58,7 @@ jobs: - name: Build docs env: # needs to be in sync with [package.metadata.docs.rs] + RUSTFLAGS: --cfg docsrs_dep RUSTDOCFLAGS: -Zunstable-options --cfg=docsrs --generate-link-to-definition run: | cargo doc \ diff --git a/Cargo.toml b/Cargo.toml index 2e42dc62e40e4..f8cb386c328d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3368,7 +3368,7 @@ panic = "abort" # impls for re-exported traits. See https://github.com/rust-lang/cargo/issues/8811 # for details on why this is needed. Since dependencies don't expect to be built # with `--cfg docsrs` (and thus fail to compile) we use a different cfg. -rustc-args = ["--cfg docsrs_dep"] +rustc-args = ["--cfg", "docsrs_dep"] rustdoc-args = ["-Zunstable-options", "--generate-link-to-definition"] all-features = true cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]