Skip to content

Commit 36daa73

Browse files
authored
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 https://github.com/rust-lang/rust/blob/80c34983c63968c204096e79b9126c0039790741/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
2 parents c8d15a3 + 6abe54c commit 36daa73

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cargo/core/compiler/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,8 +810,10 @@ fn prepare_rustdoc(build_runner: &BuildRunner<'_, '_>, unit: &Unit) -> CargoResu
810810
add_allow_features(build_runner, &mut rustdoc);
811811

812812
if build_runner.bcx.gctx.cli_unstable().rustdoc_depinfo {
813+
// toolchain-shared-resources is required for keeping the shared styling resources
813814
// invocation-specific is required for keeping the original rustdoc emission
814-
let mut arg = OsString::from("--emit=invocation-specific,dep-info=");
815+
let mut arg =
816+
OsString::from("--emit=toolchain-shared-resources,invocation-specific,dep-info=");
815817
arg.push(rustdoc_dep_info_loc(build_runner, unit));
816818
rustdoc.arg(arg);
817819

0 commit comments

Comments
 (0)