pub fn type_id_hash(self, ty: Ty<'tcx>) -> u64 {
        let mut hasher = StableHasher::new();
        let mut hcx = self.create_stable_hashing_context();

        // We want the type_id be independent of the types free regions, so we
        // erase them. The erase_regions() call will also anonymize bound
        // regions, which is desirable too.
        let ty = self.erase_regions(&ty);

        hcx.while_hashing_spans(false, |hcx| {
            hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
                ty.hash_stable(hcx, &mut hasher);
            });
        });
        hasher.finish()
    }
/// Creates a hash of the type `Ty` which will be the same no matter what crate
/// context it's calculated within. This is used by the `type_id` intrinsic.
Creates a hash of the type `Ty` which will be the same no matter what crate
context it's calculated within. This is used by the `type_id` intrinsic.
Creates a hash of the type ` Ty ` which will be the same no matter what crate context it ' s calculated within . This is used by the ` type_id ` intrinsic .
pub fn type_id_hash(self, ty: Ty<'tcx>) -> u64 {
        let mut hasher = StableHasher::new();
        let mut hcx = self.create_stable_hashing_context();
        // We want the type_id be independent of the types free regions, so we
        // erase them. The erase_regions() call will also anonymize bound
        // regions, which is desirable too.
        let ty = self.erase_regions(&ty);
        hcx.while_hashing_spans(false, |hcx| {
            hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
                ty.hash_stable(hcx, &mut hasher);
            });
        });
        hasher.finish()
    }
pub fn type_id_hash ( self , ty : Ty < ' tcx > ) -> u64 { let mut hasher = StableHasher :: new ( ) ; let mut hcx = self . create_stable_hashing_context ( ) ; // We want the type_id be independent of the types free regions, so we // erase them. The erase_regions() call will also anonymize bound // regions, which is desirable too. let ty = self . erase_regions ( & ty ) ; hcx . while_hashing_spans ( false , | hcx | { hcx . with_node_id_hashing_mode ( NodeIdHashingMode :: HashDefPath , | hcx | { ty . hash_stable ( hcx , & mut hasher ) ; } ) ; } ) ; hasher . finish ( ) }
Creates a hash of the type `Ty` which will be the same no matter what crate
context it's calculated within.
Creates a hash of the type ` Ty ` which will be the same no matter what crate context it ' s calculated within .
self
ty
Ty<'tcx>