From a34651502c65ed48f4a13f422386d8903ebb584c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tau=20G=C3=A4rtli?= Date: Wed, 14 Aug 2024 15:30:45 +0200 Subject: [PATCH] Sync flags in docs.yml with `package.metadata.docs.rs` (#14734) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Objective This PR is a follow-up to #14703. I forgot to also add the flags from `package.metadata.docs.rs` to the docs build. ## Solution As [discussed on Discord](https://discord.com/channels/691052431525675048/1272629407659589663/1272643734260940940), I added the missing flags to `docs.yml`. I also updated `rustc-args` to properly make use of the array (I think the value has to be either a space-separated string *or* an array of strings but not an array of space-separated strings 😆) --- .github/workflows/docs.yml | 1 + Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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"]