File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -186,10 +186,29 @@ fn dump_path(
186186 let item_name = tcx
187187 . def_path ( source. def_id ( ) )
188188 . to_filename_friendly_no_crate ( ) ;
189+ // All drop shims have the same DefId, so we have to add the type
190+ // to get unique file names.
191+ let shim_disambiguator = match source. instance {
192+ ty:: InstanceDef :: DropGlue ( _, Some ( ty) ) => {
193+ // Unfortunately, pretty-printed typed are not very filename-friendly.
194+ // We dome some filtering.
195+ let mut s = "." . to_owned ( ) ;
196+ s. extend ( ty. to_string ( )
197+ . chars ( )
198+ . filter_map ( |c| match c {
199+ ' ' => None ,
200+ ':' => Some ( '_' ) ,
201+ c => Some ( c)
202+ } ) ) ;
203+ s
204+ }
205+ _ => String :: new ( ) ,
206+ } ;
189207
190208 let file_name = format ! (
191- "rustc.{}{}{}.{}.{}.{}" ,
209+ "rustc.{}{}{}{} .{}.{}.{}" ,
192210 item_name,
211+ shim_disambiguator,
193212 promotion_id,
194213 pass_num,
195214 pass_name,
You can’t perform that action at this time.
0 commit comments