Skip to content

Commit

Permalink
Rollup merge of rust-lang#79968 - bjorn3:better_drop_glue_debuginfo, …
Browse files Browse the repository at this point in the history
…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 rust-lang#77465

(I haven't yet updated the tests)
  • Loading branch information
JohnTitor authored Jan 10, 2021
2 parents 4fa5e57 + 4a48d68 commit 36d8242
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 36d8242

Please sign in to comment.