1
Fork 0

Auto merge of #85829 - bjorn3:simplify_crate_num, r=jackh726

Remove CrateNum::ReservedForIncrCompCache

It's only use is easily replaceable with `Option<CrateNum>`.
This commit is contained in:
bors 2021-06-01 20:09:03 +00:00
commit 625d5a693e
7 changed files with 12 additions and 71 deletions

View file

@ -269,7 +269,7 @@ pub struct CrateVariancesMap<'tcx> {
// the types of AST nodes.
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
pub struct CReaderCacheKey {
pub cnum: CrateNum,
pub cnum: Option<CrateNum>,
pub pos: usize,
}

View file

@ -755,8 +755,7 @@ impl<'a, 'tcx> TyDecoder<'tcx> for CacheDecoder<'a, 'tcx> {
{
let tcx = self.tcx();
let cache_key =
ty::CReaderCacheKey { cnum: CrateNum::ReservedForIncrCompCache, pos: shorthand };
let cache_key = ty::CReaderCacheKey { cnum: None, pos: shorthand };
if let Some(&ty) = tcx.ty_rcache.borrow().get(&cache_key) {
return Ok(ty);