diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2021-01-10 16:55:55 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-10 16:55:55 +0900 |
| commit | f90c7f0f42dbebbb85d9699b5826b0b103b0fbde (patch) | |
| tree | c7fe47c1ea89a479a34ab7e07eb04ce8f60d61b0 | |
| parent | 5c0f5b69c2b11a16f34ff25da69be831336f3596 (diff) | |
| parent | 4a48d680f2a27d3aff5507e973035681a2bec854 (diff) | |
| download | rust-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.rs | 10 |
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 { |
