@@ -324,7 +324,7 @@ impl<'tcx> TypeMap<'tcx> {
324
324
output : & mut String ) {
325
325
// First, find out the 'real' def_id of the type. Items inlined from
326
326
// other crates have to be mapped back to their source.
327
- let source_def_id = if let Some ( node_id) = cx. tcx ( ) . map . as_local_node_id ( def_id) {
327
+ let def_id = if let Some ( node_id) = cx. tcx ( ) . map . as_local_node_id ( def_id) {
328
328
match cx. external_srcs ( ) . borrow ( ) . get ( & node_id) . cloned ( ) {
329
329
Some ( source_def_id) => {
330
330
// The given def_id identifies the inlined copy of a
@@ -337,19 +337,21 @@ impl<'tcx> TypeMap<'tcx> {
337
337
def_id
338
338
} ;
339
339
340
- // Get the crate hash as first part of the identifier.
341
- let crate_hash = if source_def_id . is_local ( ) {
342
- cx. link_meta ( ) . crate_hash . clone ( )
340
+ // Get the crate name/disambiguator as first part of the identifier.
341
+ let crate_name = if def_id . is_local ( ) {
342
+ cx. tcx ( ) . crate_name . clone ( )
343
343
} else {
344
- cx. sess ( ) . cstore . crate_hash ( source_def_id . krate )
344
+ cx. sess ( ) . cstore . original_crate_name ( def_id . krate )
345
345
} ;
346
+ let crate_disambiguator = cx. tcx ( ) . crate_disambiguator ( def_id. krate ) ;
346
347
347
- output. push_str ( crate_hash . as_str ( ) ) ;
348
+ output. push_str ( & crate_name [ .. ] ) ;
348
349
output. push_str ( "/" ) ;
350
+ output. push_str ( & crate_disambiguator[ ..] ) ;
351
+ output. push_str ( "/" ) ;
352
+ // Add the def-index as the second part
349
353
output. push_str ( & format ! ( "{:x}" , def_id. index. as_usize( ) ) ) ;
350
354
351
- // Maybe check that there is no self type here.
352
-
353
355
let tps = substs. types . get_slice ( subst:: TypeSpace ) ;
354
356
if !tps. is_empty ( ) {
355
357
output. push ( '<' ) ;
0 commit comments