]> git.lizzy.rs Git - rust.git/blobdiff - src/bootstrap/builder.rs
clean up error codes explanation
[rust.git] / src / bootstrap / builder.rs
index 068cc2315e1a9114a8a3ff5370b4651e7ae80afd..00c8e72a8f6851c82c68a4f0cd2925d8fd3ed584 100644 (file)
@@ -343,6 +343,7 @@ macro_rules! describe {
                 tool::Rustdoc,
                 tool::Clippy,
                 native::Llvm,
+                native::Sanitizers,
                 tool::Rustfmt,
                 tool::Miri,
                 native::Lld
@@ -1195,6 +1196,21 @@ pub fn cargo(
             rustflags.arg("-Cprefer-dynamic");
         }
 
+        // When building incrementally we default to a lower ThinLTO import limit
+        // (unless explicitly specified otherwise). This will produce a somewhat
+        // slower code but give way better compile times.
+        {
+            let limit = match self.config.rust_thin_lto_import_instr_limit {
+                Some(limit) => Some(limit),
+                None if self.config.incremental => Some(10),
+                _ => None,
+            };
+
+            if let Some(limit) = limit {
+                rustflags.arg(&format!("-Cllvm-args=-import-instr-limit={}", limit));
+            }
+        }
+
         Cargo { command: cargo, rustflags }
     }