diff --git a/src/cargo/core/compiler/compilation.rs b/src/cargo/core/compiler/compilation.rs index e4cccf2609a1..39f0f9f7241a 100644 --- a/src/cargo/core/compiler/compilation.rs +++ b/src/cargo/core/compiler/compilation.rs @@ -199,7 +199,10 @@ impl<'gctx> Compilation<'gctx> { unit: &Unit, script_meta: Option, ) -> CargoResult { - let rustdoc = ProcessBuilder::new(&*self.gctx.rustdoc()?); + let mut rustdoc = ProcessBuilder::new(&*self.gctx.rustdoc()?); + if self.gctx.extra_verbose() { + rustdoc.display_env_vars(); + } let cmd = fill_rustc_tool_env(rustdoc, unit); let mut cmd = self.fill_env(cmd, &unit.pkg, script_meta, unit.kind, ToolKind::Rustdoc)?; cmd.retry_with_argfile(true); diff --git a/tests/testsuite/profile_targets.rs b/tests/testsuite/profile_targets.rs index 8aa2c372db69..2c3a08ff79a5 100644 --- a/tests/testsuite/profile_targets.rs +++ b/tests/testsuite/profile_targets.rs @@ -724,7 +724,7 @@ fn profile_selection_doc() { [RUNNING] `[..][ROOT]/foo/target/debug/build/foo-[HASH]/build-script-build` [foo 0.0.1] foo custom build PROFILE=debug DEBUG=true OPT_LEVEL=0 [DOCUMENTING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustdoc [..]--crate-name foo src/lib.rs [..] +[RUNNING] `[..] rustdoc [..]--crate-name foo src/lib.rs [..] [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [GENERATED] [ROOT]/foo/target/doc/foo/index.html