about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/debuginfo/namespace.rs
diff options
context:
space:
mode:
authormarmeladema <xademax@gmail.com>2020-09-01 13:11:28 +0100
committermarmeladema <xademax@gmail.com>2020-09-25 22:46:15 +0100
commitbb8e1764bb31bc63a6b61f446e28bb567015de01 (patch)
treec9ad2139a7766766b231bac74e8751f8e8609d23 /compiler/rustc_codegen_llvm/src/debuginfo/namespace.rs
parent75130b06bff9cf4af528cf19513f802a837bdd23 (diff)
downloadrust-bb8e1764bb31bc63a6b61f446e28bb567015de01.tar.gz
rust-bb8e1764bb31bc63a6b61f446e28bb567015de01.zip
Simplify some match statements on `DefPathDataName'
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo/namespace.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/namespace.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/namespace.rs b/compiler/rustc_codegen_llvm/src/debuginfo/namespace.rs
index 661d13ead83..512fc87905e 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/namespace.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/namespace.rs
@@ -7,7 +7,7 @@ use crate::common::CodegenCx;
 use crate::llvm;
 use crate::llvm::debuginfo::DIScope;
 use rustc_hir::def_id::DefId;
-use rustc_hir::definitions::{DefPathData, DefPathDataName};
+use rustc_hir::definitions::DefPathData;
 use rustc_span::symbol::Symbol;
 
 pub fn mangled_name_of_instance<'a, 'tcx>(
@@ -30,12 +30,7 @@ pub fn item_namespace(cx: &CodegenCx<'ll, '_>, def_id: DefId) -> &'ll DIScope {
 
     let namespace_name = match def_key.disambiguated_data.data {
         DefPathData::CrateRoot => cx.tcx.crate_name(def_id.krate),
-        data => match data.name() {
-            DefPathDataName::Named(name) => name,
-            DefPathDataName::Anon { namespace } => {
-                Symbol::intern(&format!("{{{{{}}}}}", namespace))
-            }
-        },
+        data => Symbol::intern(&data.to_string()),
     };
     let namespace_name = namespace_name.as_str();