fix(doc): pass toolchain-shared-resources to get doc styled (#15605)

### What does this PR try to resolve?

Fixes #15604

rustdoc assumes to add static files only when the
toolchain-shared-resources emit-type is specified, or when no emit-type
is specified.

See
80c34983c6/src/librustdoc/html/render/write_shared.rs (L206-L213)

### How should we test and review this PR?

Not going to write a test because I don't think we want to inspect into
how rustdoc arranges static files.

See #15604 for how to reproduce/test.

### Additional information

cc #15370
This commit is contained in:
Ed Page 2025-05-28 21:03:49 +00:00 committed by GitHub
commit 36daa739ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -810,8 +810,10 @@ fn prepare_rustdoc(build_runner: &BuildRunner<'_, '_>, unit: &Unit) -> CargoResu
add_allow_features(build_runner, &mut rustdoc);
if build_runner.bcx.gctx.cli_unstable().rustdoc_depinfo {
// toolchain-shared-resources is required for keeping the shared styling resources
// invocation-specific is required for keeping the original rustdoc emission
let mut arg = OsString::from("--emit=invocation-specific,dep-info=");
let mut arg =
OsString::from("--emit=toolchain-shared-resources,invocation-specific,dep-info=");
arg.push(rustdoc_dep_info_loc(build_runner, unit));
rustdoc.arg(arg);