about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2021-01-10 16:55:55 +0900
committerGitHub <noreply@github.com>2021-01-10 16:55:55 +0900
commitf90c7f0f42dbebbb85d9699b5826b0b103b0fbde (patch)
treec7fe47c1ea89a479a34ab7e07eb04ce8f60d61b0
parent5c0f5b69c2b11a16f34ff25da69be831336f3596 (diff)
parent4a48d680f2a27d3aff5507e973035681a2bec854 (diff)
downloadrust-f90c7f0f42dbebbb85d9699b5826b0b103b0fbde.tar.gz
rust-f90c7f0f42dbebbb85d9699b5826b0b103b0fbde.zip
Rollup merge of #79968 - bjorn3:better_drop_glue_debuginfo, r=matthewjasper
Improve core::ptr::drop_in_place debuginfo

* Use span of the dropped type as function span when possible.
* Rename symbol from `core::ptr::drop_in_place::$hash` to `{{drop}}::<$TYPE>::$hash`.

Fixes #77465

(I haven't yet updated the tests)
-rw-r--r--compiler/rustc_symbol_mangling/src/legacy.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/rustc_symbol_mangling/src/legacy.rs b/compiler/rustc_symbol_mangling/src/legacy.rs
index 6356a7e7832..b0d5f340902 100644
--- a/compiler/rustc_symbol_mangling/src/legacy.rs
+++ b/compiler/rustc_symbol_mangling/src/legacy.rs
@@ -56,7 +56,15 @@ pub(super) fn mangle(
     let hash = get_symbol_hash(tcx, instance, instance_ty, instantiating_crate);
 
     let mut printer = SymbolPrinter { tcx, path: SymbolPath::new(), keep_within_component: false }
-        .print_def_path(def_id, &[])
+        .print_def_path(
+            def_id,
+            if let ty::InstanceDef::DropGlue(_, _) = instance.def {
+                // Add the name of the dropped type to the symbol name
+                &*instance.substs
+            } else {
+                &[]
+            },
+        )
         .unwrap();
 
     if let ty::InstanceDef::VtableShim(..) = instance.def {