Skip to content

Commit f729340

Browse files
committed
Inline and remove two StableHashingContext methods.
They both have a single use. Also adjust a couple of visibilities.
1 parent 99b9f51 commit f729340

1 file changed

Lines changed: 6 additions & 16 deletions

File tree

  • compiler/rustc_query_system/src/ich

compiler/rustc_query_system/src/ich/hcx.rs

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,7 @@ impl<'a> StableHashingContext<'a> {
5151
}
5252

5353
#[inline]
54-
pub fn def_path_hash(&self, def_id: DefId) -> DefPathHash {
55-
if let Some(def_id) = def_id.as_local() {
56-
self.local_def_path_hash(def_id)
57-
} else {
58-
self.untracked.cstore.read().def_path_hash(def_id)
59-
}
60-
}
61-
62-
#[inline]
63-
pub fn local_def_path_hash(&self, def_id: LocalDefId) -> DefPathHash {
64-
self.untracked.definitions.read().def_path_hash(def_id)
65-
}
66-
67-
#[inline]
68-
pub fn source_map(&mut self) -> &mut CachingSourceMapView<'a> {
54+
fn source_map(&mut self) -> &mut CachingSourceMapView<'a> {
6955
match self.caching_source_map {
7056
CachingSourceMap::InUse(ref mut sm) => sm,
7157
CachingSourceMap::Unused(sm) => {
@@ -96,7 +82,11 @@ impl<'a> rustc_span::HashStableContext for StableHashingContext<'a> {
9682

9783
#[inline]
9884
fn def_path_hash(&self, def_id: DefId) -> DefPathHash {
99-
self.def_path_hash(def_id)
85+
if let Some(def_id) = def_id.as_local() {
86+
self.untracked.definitions.read().def_path_hash(def_id)
87+
} else {
88+
self.untracked.cstore.read().def_path_hash(def_id)
89+
}
10090
}
10191

10292
#[inline]

0 commit comments

Comments
 (0)