Skip to content

Commit 1de34eb

Browse files
committed
avoid read cache map
1 parent 4bb2cbb commit 1de34eb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/rustc_middle/src/query/on_disk_cache.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ pub struct OnDiskCache<'sess> {
9595
// we try to map an `ExpnHash` to its value in the current
9696
// compilation session.
9797
foreign_expn_data: UnhashMap<ExpnHash, u32>,
98+
has_cache: bool,
9899
}
99100

100101
// This type is used only for serialization and deserialization.
@@ -194,6 +195,7 @@ impl<'sess> OnDiskCache<'sess> {
194195
expn_data: footer.expn_data,
195196
foreign_expn_data: footer.foreign_expn_data,
196197
hygiene_context: Default::default(),
198+
has_cache: true,
197199
}
198200
}
199201

@@ -211,11 +213,12 @@ impl<'sess> OnDiskCache<'sess> {
211213
expn_data: UnhashMap::default(),
212214
foreign_expn_data: UnhashMap::default(),
213215
hygiene_context: Default::default(),
216+
has_cache: false,
214217
}
215218
}
216219

217220
pub fn has_cache(&self) -> bool {
218-
self.serialized_data.read().is_some()
221+
self.has_cache
219222
}
220223

221224
/// Execute all cache promotions and release the serialized backing Mmap.

0 commit comments

Comments
 (0)