Create a single value cache for the () query key
This commit is contained in:
parent
2b3f260e74
commit
80d265240b
3 changed files with 50 additions and 4 deletions
|
@ -8,7 +8,7 @@ use crate::ty::subst::{GenericArg, SubstsRef};
|
|||
use crate::ty::{self, layout::TyAndLayout, Ty, TyCtxt};
|
||||
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
|
||||
use rustc_hir::hir_id::{HirId, OwnerId};
|
||||
use rustc_query_system::query::{DefaultCacheSelector, VecCacheSelector};
|
||||
use rustc_query_system::query::{DefaultCacheSelector, SingleCacheSelector, VecCacheSelector};
|
||||
use rustc_span::symbol::{Ident, Symbol};
|
||||
use rustc_span::{Span, DUMMY_SP};
|
||||
|
||||
|
@ -45,7 +45,7 @@ pub trait Key: Sized {
|
|||
}
|
||||
|
||||
impl Key for () {
|
||||
type CacheSelector = DefaultCacheSelector<Self>;
|
||||
type CacheSelector = SingleCacheSelector;
|
||||
|
||||
#[inline(always)]
|
||||
fn query_crate_is_local(&self) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue