about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2024-04-17 18:14:16 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2024-04-18 09:35:36 -0700
commit90b4c86335f625f64e6238614d4c7cfd0dbbb37a (patch)
tree416c7ef4a7886e4d4da85bc084bacc0ba750508a /src/bootstrap
parent6094063c35d3b3f7c07b6c069ebeb27797ddadc1 (diff)
downloadrust-90b4c86335f625f64e6238614d4c7cfd0dbbb37a.tar.gz
rust-90b4c86335f625f64e6238614d4c7cfd0dbbb37a.zip
Ensure `[rust] debuginfo-level-std` doesn't change core's MIR
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