@@ -510,7 +510,8 @@ fn truncated_hash_result(symbol_hasher: &mut Sha256) -> ~str {
510
510
pub fn symbol_hash ( tcx : ty:: ctxt ,
511
511
symbol_hasher : & mut Sha256 ,
512
512
t : ty:: t ,
513
- link_meta : & LinkMeta ) -> @str {
513
+ link_meta : & LinkMeta )
514
+ -> ~str {
514
515
// NB: do *not* use abbrevs here as we want the symbol names
515
516
// to be independent of one another in the crate.
516
517
@@ -523,23 +524,22 @@ pub fn symbol_hash(tcx: ty::ctxt,
523
524
let mut hash = truncated_hash_result ( symbol_hasher) ;
524
525
// Prefix with 'h' so that it never blends into adjacent digits
525
526
hash. unshift_char ( 'h' ) ;
526
- // tjc: allocation is unfortunate; need to change std::hash
527
- hash. to_managed ( )
527
+ hash
528
528
}
529
529
530
- pub fn get_symbol_hash ( ccx : & CrateContext , t : ty:: t ) -> @ str {
530
+ pub fn get_symbol_hash ( ccx : & CrateContext , t : ty:: t ) -> ~ str {
531
531
{
532
532
let type_hashcodes = ccx. type_hashcodes . borrow ( ) ;
533
533
match type_hashcodes. get ( ) . find ( & t) {
534
- Some ( & h) => return h,
534
+ Some ( h) => return h. to_str ( ) ,
535
535
None => { }
536
536
}
537
537
}
538
538
539
539
let mut type_hashcodes = ccx. type_hashcodes . borrow_mut ( ) ;
540
540
let mut symbol_hasher = ccx. symbol_hasher . borrow_mut ( ) ;
541
541
let hash = symbol_hash ( ccx. tcx , symbol_hasher. get ( ) , t, & ccx. link_meta ) ;
542
- type_hashcodes. get ( ) . insert ( t, hash) ;
542
+ type_hashcodes. get ( ) . insert ( t, hash. clone ( ) ) ;
543
543
hash
544
544
}
545
545
0 commit comments