File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
compiler/rustc_symbol_mangling/src Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,26 @@ pub(super) fn mangle(
5555
5656 let hash = get_symbol_hash ( tcx, instance, instance_ty, instantiating_crate) ;
5757
58+ if let ty:: InstanceDef :: DropGlue ( _drop_in_place, ty) = instance. def {
59+ // Use `{{drop}}::<$TYPE>::$hash` as name for the drop glue instead of
60+ // `core::mem::drop_in_place::$hash`.
61+ let mut printer =
62+ SymbolPrinter { tcx, path : SymbolPath :: new ( ) , keep_within_component : false } ;
63+ printer. write_str ( "{{drop}}" ) . unwrap ( ) ;
64+ printer. path . finalize_pending_component ( ) ;
65+ let printer = printer
66+ . generic_delimiters ( |mut printer| {
67+ if let Some ( ty) = ty {
68+ printer. print_type ( ty)
69+ } else {
70+ printer. write_str ( "_" ) ?;
71+ Ok ( printer)
72+ }
73+ } )
74+ . unwrap ( ) ;
75+ return printer. path . finish ( hash) ;
76+ }
77+
5878 let mut printer = SymbolPrinter { tcx, path : SymbolPath :: new ( ) , keep_within_component : false }
5979 . print_def_path ( def_id, & [ ] )
6080 . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments