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)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user