about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-12-13 08:32:20 +0000
committerbors <bors@rust-lang.org>2024-12-13 08:32:20 +0000
commitdd436ae2a628c523c967a7876873a96c44b1e382 (patch)
treed51ba38fa449f1a7800fef03f19565ac9a3e7cb6 /src/bootstrap
parent3da8bfb87f2bdcff56ed845383aa1c4fcd2c8705 (diff)
parenta7fc76a3ab640fa1d6d95b6b722ed4d82d4e333e (diff)
Auto merge of #133899 - scottmcm:strip-mir-debuginfo, r=oli-obk
We don't need `NonNull::as_ptr` debuginfo

In order to stop pessimizing the use of local variables in core, skip debug info for MIR temporaries in tiny (single-BB) functions.

For functions as simple as this -- `Pin::new`, etc -- nobody every actually wants debuginfo for them in the first place.  They're more like intrinsics than real functions, and stepping over them is good.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/core/builder/cargo.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs
index 6e848628e5c..96d3162a8c5 100644
--- a/src/bootstrap/src/core/builder/cargo.rs
+++ b/src/bootstrap/src/core/builder/cargo.rs
@@ -1203,6 +1203,11 @@ impl Builder<'_> {
             // 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");
+
+            // FIXME: always pass this after the next `#[cfg(bootstrap)]` update.
+            if compiler.stage != 0 {
+                rustflags.arg("-Zmir_strip_debuginfo=locals-in-tiny-functions");
+            }
         }
 
         Cargo {