fn symbol_hash<'tcx>(tcx: &ty::ctxt<'tcx>,
                     symbol_hasher: &mut Sha256,
                     t: Ty<'tcx>,
                     link_meta: &LinkMeta)
                     -> String {
    // NB: do *not* use abbrevs here as we want the symbol names
    // to be independent of one another in the crate.

    symbol_hasher.reset();
    symbol_hasher.input_str(&link_meta.crate_name);
    symbol_hasher.input_str("-");
    symbol_hasher.input_str(link_meta.crate_hash.as_str());
    for meta in tcx.sess.crate_metadata.borrow().iter() {
        symbol_hasher.input_str(&meta[..]);
    }
    symbol_hasher.input_str("-");
    symbol_hasher.input_str(&encoder::encoded_ty(tcx, t));
    // Prefix with 'h' so that it never blends into adjacent digits
    let mut hash = String::from("h");
    hash.push_str(&truncated_hash_result(symbol_hasher));
    hash
}
// This calculates STH for a symbol, as defined above
This calculates STH for a symbol, as defined above
This calculates STH for a symbol as defined above
fn symbol_hash<'tcx>(tcx: &ty::ctxt<'tcx>,
                     symbol_hasher: &mut Sha256,
                     t: Ty<'tcx>,
                     link_meta: &LinkMeta)
                     -> String {
    // NB: do *not* use abbrevs here as we want the symbol names
    // to be independent of one another in the crate.
    symbol_hasher.reset();
    symbol_hasher.input_str(&link_meta.crate_name);
    symbol_hasher.input_str("-");
    symbol_hasher.input_str(link_meta.crate_hash.as_str());
    for meta in tcx.sess.crate_metadata.borrow().iter() {
        symbol_hasher.input_str(&meta[..]);
    }
    symbol_hasher.input_str("-");
    symbol_hasher.input_str(&encoder::encoded_ty(tcx, t));
    // Prefix with 'h' so that it never blends into adjacent digits
    let mut hash = String::from("h");
    hash.push_str(&truncated_hash_result(symbol_hasher));
    hash
}
fn symbol_hash < ' tcx > ( tcx : & ty :: ctxt < ' tcx > , symbol_hasher : & mut Sha256 , t : Ty < ' tcx > , link_meta : & LinkMeta ) -> String { // NB: do *not* use abbrevs here as we want the symbol names // to be independent of one another in the crate. symbol_hasher . reset ( ) ; symbol_hasher . input_str ( & link_meta . crate_name ) ; symbol_hasher . input_str ( " " ) ; symbol_hasher . input_str ( link_meta . crate_hash . as_str ( ) ) ; for meta in tcx . sess . crate_metadata . borrow ( ) . iter ( ) { symbol_hasher . input_str ( & meta [ .. ] ) ; } symbol_hasher . input_str ( " " ) ; symbol_hasher . input_str ( & encoder :: encoded_ty ( tcx , t ) ) ; // Prefix with 'h' so that it never blends into adjacent digits let mut hash = String :: from ( " " ) ; hash . push_str ( & truncated_hash_result ( symbol_hasher ) ) ; hash }
This calculates STH for a symbol, as defined above
This calculates STH for a symbol as defined above
tcx
&ty::ctxt<'tcx>
symbol_hasher
&mut Sha256
t
Ty<'tcx>
link_meta
&LinkMeta
tcx
&ty::ctxt<'tcx>
symbol_hasher
&mut Sha256
t
Ty<'tcx>
link_meta
&LinkMeta