diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 6874efa5a4c73..484e8b9b7432f 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -756,7 +756,9 @@ impl<'a> Builder<'a> { } } - if mode == Mode::Libstd && self.config.extended && compiler.is_final_stage(self) { + if cmd == "build" && mode == Mode::Libstd + && self.config.extended && compiler.is_final_stage(self) + { cargo.env("RUSTC_SAVE_ANALYSIS", "api".to_string()); }