diff options
| author | bors <bors@rust-lang.org> | 2024-03-14 06:46:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-14 06:46:16 +0000 |
| commit | 24071bdf889d89052efcb3245c6de90a8899526e (patch) | |
| tree | eec550e91293d7ce0f751cfad6e41493186a515c /compiler/rustc_codegen_llvm/src/debuginfo | |
| parent | 34d6f07646e28977a2b7fb5c90202b6973c4441e (diff) | |
| parent | 4cd673b4c6b6c633ea768b7d5ff1dbfead53c153 (diff) | |
| download | rust-24071bdf889d89052efcb3245c6de90a8899526e.tar.gz rust-24071bdf889d89052efcb3245c6de90a8899526e.zip | |
Auto merge of #3378 - rust-lang:rustup-2024-03-14, r=RalfJung
Automatic Rustup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs index 660f1647367..5782b156335 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs @@ -26,6 +26,7 @@ use rustc_codegen_ssa::debuginfo::type_names::VTableNameKind; use rustc_codegen_ssa::traits::*; use rustc_fs_util::path_to_c_string; use rustc_hir::def::CtorKind; +use rustc_hir::def::DefKind; use rustc_hir::def_id::{DefId, LOCAL_CRATE}; use rustc_middle::bug; use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; @@ -1309,6 +1310,11 @@ pub fn build_global_var_di_node<'ll>(cx: &CodegenCx<'ll, '_>, def_id: DefId, glo }; let is_local_to_unit = is_node_local_to_unit(cx, def_id); + + let DefKind::Static { nested, .. } = cx.tcx.def_kind(def_id) else { bug!() }; + if nested { + return; + } let variable_type = Instance::mono(cx.tcx, def_id).ty(cx.tcx, ty::ParamEnv::reveal_all()); let type_di_node = type_di_node(cx, variable_type); let var_name = tcx.item_name(def_id); |
