Skip to content

Commit 9c25d40

Browse files
committed
Honor collapse_debuginfo for statics.
fixes rust-lang#126363
1 parent 8337ba9 commit 9c25d40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use rustc_middle::ty::{
3636
};
3737
use rustc_session::config::{self, DebugInfo, Lto};
3838
use rustc_span::symbol::Symbol;
39-
use rustc_span::FileName;
39+
use rustc_span::{hygiene, FileName, DUMMY_SP};
4040
use rustc_span::{FileNameDisplayPreference, SourceFile};
4141
use rustc_symbol_mangling::typeid_for_trait_ref;
4242
use rustc_target::abi::{Align, Size};
@@ -1306,7 +1306,7 @@ pub fn build_global_var_di_node<'ll>(cx: &CodegenCx<'ll, '_>, def_id: DefId, glo
13061306
// We may want to remove the namespace scope if we're in an extern block (see
13071307
// https://github.com/rust-lang/rust/pull/46457#issuecomment-351750952).
13081308
let var_scope = get_namespace_for_item(cx, def_id);
1309-
let span = tcx.def_span(def_id);
1309+
let span = hygiene::walk_chain_collapsed(tcx.def_span(def_id), DUMMY_SP);
13101310

13111311
let (file_metadata, line_number) = if !span.is_dummy() {
13121312
let loc = cx.lookup_debug_loc(span.lo());

0 commit comments

Comments
 (0)