diff --git a/.cargo/config.toml b/.cargo/config.toml index 222cbe1dc8d..53c737cc89f 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -37,4 +37,5 @@ rustflags = [ # activate the target-applies-to-host feature. # Required for `target-applies-to-host` at the top to take effect. [unstable] +rustdoc-map = true target-applies-to-host = true diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 64589291068..d754d586722 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -29,10 +29,12 @@ jobs: - name: Build docs uses: actions-rs/cargo@v1 env: + # Work around https://github.com/rust-lang/cargo/issues/10744 + CARGO_TARGET_APPLIES_TO_HOST: "true" RUSTDOCFLAGS: "--enable-index-page -Zunstable-options --cfg docsrs -Dwarnings" with: command: doc - args: --no-deps --workspace --exclude matrix-sdk-crypto-js --exclude matrix-sdk-crypto-nodejs --features docsrs -Zrustdoc-map + args: --no-deps --workspace --exclude matrix-sdk-crypto-js --exclude matrix-sdk-crypto-nodejs --features docsrs - name: Deploy docs if: github.event_name == 'push' && github.ref == 'refs/heads/main' diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 8b603523331..79658ec260d 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -51,7 +51,9 @@ fn build_docs( } // Keep in sync with .github/workflows/docs.yml - cmd!("rustup run nightly cargo doc --no-deps --workspace --features docsrs -Zrustdoc-map") + cmd!("rustup run nightly cargo doc --no-deps --workspace --features docsrs") + // Work around https://github.com/rust-lang/cargo/issues/10744 + .env("CARGO_TARGET_APPLIES_TO_HOST", "true") .env("RUSTDOCFLAGS", rustdocflags) .args(extra_args) .run()?;