about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/core/builder.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
index 499a74be6b1..80c38b80e77 100644
--- a/src/bootstrap/src/core/builder.rs
+++ b/src/bootstrap/src/core/builder.rs
@@ -2102,6 +2102,14 @@ impl<'a> Builder<'a> {
             // break when incremental compilation is enabled. So this overrides the "no inlining
             // during incremental builds" heuristic for the standard library.
             rustflags.arg("-Zinline-mir");
+
+            // always pass this after the next `#[cfg(bootstrap)]` update.
+            if compiler.stage != 0 {
+                // Similarly, we need to keep debug info for functions inlined into other std functions,
+                // even if we're not going to output debuginfo for the crate we're currently building,
+                // so that it'll be available when downstream consumers of std try to use it.
+                rustflags.arg("-Zinline-mir-preserve-debug");
+            }
         }
 
         if self.config.rustc_parallel