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