about summary refs log tree commit diff
path: root/compiler/rustc_hir/src/def.rs
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-02-26 18:03:06 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-03-12 05:53:46 +0000
commitd3514a036dc65c1d31ee5b1b4bd58b9be1edf5af (patch)
tree95685bb9f89cc23836f86c958b346447e8fd5356 /compiler/rustc_hir/src/def.rs
parent92414ab25d5b9ddbee37d458e53e70ee4813d5ca (diff)
downloadrust-d3514a036dc65c1d31ee5b1b4bd58b9be1edf5af.tar.gz
rust-d3514a036dc65c1d31ee5b1b4bd58b9be1edf5af.zip
Ensure nested allocations in statics do not get deduplicated
Diffstat (limited to 'compiler/rustc_hir/src/def.rs')
-rw-r--r--compiler/rustc_hir/src/def.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_hir/src/def.rs b/compiler/rustc_hir/src/def.rs
index 63dee3a5738..361ca167010 100644
--- a/compiler/rustc_hir/src/def.rs
+++ b/compiler/rustc_hir/src/def.rs
@@ -250,6 +250,9 @@ impl DefKind {
             | DefKind::AssocTy
             | DefKind::TyParam
             | DefKind::ExternCrate => DefPathData::TypeNs(name),
+            // It's not exactly an anon const, but wrt DefPathData, there
+            // is not difference.
+            DefKind::Static { nested: true, .. } => DefPathData::AnonConst,
             DefKind::Fn
             | DefKind::Const
             | DefKind::ConstParam