Skip to content

Commit

Permalink
Rollup merge of #79968 - bjorn3:better_drop_glue_debuginfo, r=matthew…
Browse files Browse the repository at this point in the history
…jasper

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)
  • Loading branch information
JohnTitor authored Jan 10, 2021
2 parents 5c0f5b6 + 4a48d68 commit f90c7f0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion compiler/rustc_symbol_mangling/src/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f90c7f0

Please sign in to comment.