Skip to content

Commit 736f5a8

Browse files
committed
auto merge of #11247 : eddyb/rust/symbol-cleanup, r=alexcrichton
2 parents 7fc4df3 + 4e75265 commit 736f5a8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/librustc/back/link.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use std::run;
3434
use std::str;
3535
use std::io;
3636
use std::io::fs;
37+
use extra::hex::ToHex;
3738
use extra::tempfile::TempDir;
3839
use syntax::abi;
3940
use syntax::ast;
@@ -490,8 +491,10 @@ pub fn build_link_meta(sess: Session,
490491
}
491492
}
492493

493-
pub fn truncated_hash_result(symbol_hasher: &mut Sha256) -> ~str {
494-
symbol_hasher.result_str()
494+
fn truncated_hash_result(symbol_hasher: &mut Sha256) -> ~str {
495+
let output = symbol_hasher.result_bytes();
496+
// 64 bits should be enough to avoid collisions.
497+
output.slice_to(8).to_hex()
495498
}
496499

497500

0 commit comments

Comments
 (0)