From 0d072416717ca9e1ee5bbbfadb2a5671148b255a Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Tue, 9 Dec 2025 08:38:55 +0000 Subject: [PATCH] [DO NOT MERGE] Benchmark Cranelift against LLVM with line-tables-only debuginfo --- compiler/rustc_session/src/session.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index acc65fc11a2a2..92cf624fe71a5 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -990,7 +990,7 @@ fn default_emitter( #[allow(rustc::bad_opt_access)] #[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable pub fn build_session( - sopts: config::Options, + mut sopts: config::Options, io: CompilerIO, fluent_bundle: Option>, registry: rustc_errors::registry::Registry, @@ -1001,6 +1001,11 @@ pub fn build_session( ice_file: Option, using_internal_features: &'static AtomicBool, ) -> Session { + match sopts.debuginfo { + DebugInfo::None | DebugInfo::LineDirectivesOnly | DebugInfo::LineTablesOnly => {} + DebugInfo::Limited | DebugInfo::Full => sopts.debuginfo = DebugInfo::LineTablesOnly, + } + // FIXME: This is not general enough to make the warning lint completely override // normal diagnostic warnings, since the warning lint can also be denied and changed // later via the source code.