Skip to content

Commit f90c7f0

Browse files
authored
Rollup merge of rust-lang#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 rust-lang#77465 (I haven't yet updated the tests)
2 parents 5c0f5b6 + 4a48d68 commit f90c7f0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

compiler/rustc_symbol_mangling/src/legacy.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,15 @@ pub(super) fn mangle(
5656
let hash = get_symbol_hash(tcx, instance, instance_ty, instantiating_crate);
5757

5858
let mut printer = SymbolPrinter { tcx, path: SymbolPath::new(), keep_within_component: false }
59-
.print_def_path(def_id, &[])
59+
.print_def_path(
60+
def_id,
61+
if let ty::InstanceDef::DropGlue(_, _) = instance.def {
62+
// Add the name of the dropped type to the symbol name
63+
&*instance.substs
64+
} else {
65+
&[]
66+
},
67+
)
6068
.unwrap();
6169

6270
if let ty::InstanceDef::VtableShim(..) = instance.def {

0 commit comments

Comments
 (0)