rustflags.arg("--cfg=bootstrap");
}
+ // FIXME: It might be better to use the same value for both `RUSTFLAGS` and `RUSTDOCFLAGS`,
+ // but this breaks CI. At the very least, stage0 `rustdoc` needs `--cfg bootstrap`. See
+ // #71458.
+ let rustdocflags = rustflags.clone();
+
if let Ok(s) = env::var("CARGOFLAGS") {
cargo.args(s.split_whitespace());
}
}
}
- Cargo { command: cargo, rustflags }
+ Cargo { command: cargo, rustflags, rustdocflags }
}
/// Ensure that a given step is built, returning its output. This will
#[cfg(test)]
mod tests;
-#[derive(Debug)]
+#[derive(Debug, Clone)]
struct Rustflags(String);
impl Rustflags {
pub struct Cargo {
command: Command,
rustflags: Rustflags,
+ rustdocflags: Rustflags,
}
impl Cargo {
impl From<Cargo> for Command {
fn from(mut cargo: Cargo) -> Command {
cargo.command.env("RUSTFLAGS", &cargo.rustflags.0);
+ cargo.command.env("RUSTDOCFLAGS", &cargo.rustdocflags.0);
cargo.command
}
}