Add unit test to ensure that both parts of a DefPathHash depend on the defining crate's ID.
This commit is contained in:
parent
97380e3b06
commit
9e5054498b
4 changed files with 54 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue