Add unit test to ensure that both parts of a DefPathHash depend on the defining crate's ID.
This commit is contained in:
@@ -159,6 +159,12 @@ impl DefPathHash {
|
||||
StableCrateId(self.0.as_value().0)
|
||||
}
|
||||
|
||||
/// Returns the crate-local part of the [DefPathHash].
|
||||
#[inline]
|
||||
pub fn local_hash(&self) -> u64 {
|
||||
self.0.as_value().1
|
||||
}
|
||||
|
||||
/// Builds a new [DefPathHash] with the given [StableCrateId] and
|
||||
/// `local_hash`, where `local_hash` must be unique within its crate.
|
||||
pub fn new(stable_crate_id: StableCrateId, local_hash: u64) -> DefPathHash {
|
||||
|
||||
Reference in New Issue
Block a user