From 90b4c86335f625f64e6238614d4c7cfd0dbbb37a Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Wed, 17 Apr 2024 18:14:16 -0700 Subject: Ensure `[rust] debuginfo-level-std` doesn't change core's MIR --- src/bootstrap/src/core/builder.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/bootstrap') 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 -- cgit 1.4.1-3-g733a5