Skip to content

Commit ad1d541

Browse files
Set RUSTDOCFLAGS environment variable in run_cargo_command_with_callback function
1 parent 7013ecc commit ad1d541

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

build_system/src/test.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,9 +694,12 @@ where
694694
);
695695
eprintln!("Using `{}`.", rustc_toolchain_version);
696696
}
697+
let mut env = env.clone();
698+
let rustflags = env.get("RUSTFLAGS").cloned().unwrap_or_default();
699+
env.insert("RUSTDOCFLAGS".to_string(), rustflags);
697700
let mut cargo_command: Vec<&dyn AsRef<OsStr>> = vec![&"cargo", &toolchain_arg];
698701
cargo_command.extend_from_slice(&command);
699-
callback(&cargo_command, cwd, env)
702+
callback(&cargo_command, cwd, &env)
700703
}
701704

702705
// FIXME(antoyo): linker gives multiple definitions error on Linux

0 commit comments

Comments
 (0)