@@ -64,6 +64,7 @@ rustc_queries! {
64
64
/// Maps from the `DefId` of an item (trait/struct/enum/fn) to its
65
65
/// associated generics.
66
66
query generics_of( key: DefId ) -> & ' tcx ty:: Generics {
67
+ storage( caches:: LocalDenseDefIdCacheSelector <& ' tcx ty:: Generics >)
67
68
cache_on_disk_if { key. is_local( ) }
68
69
load_cached( tcx, id) {
69
70
let generics: Option <ty:: Generics > = tcx. queries. on_disk_cache
@@ -88,6 +89,7 @@ rustc_queries! {
88
89
/// to operate over only the actual where-clauses written by the
89
90
/// user.)
90
91
query predicates_of( key: DefId ) -> ty:: GenericPredicates <' tcx> {
92
+ storage( caches:: LocalDenseDefIdCacheSelector <ty:: GenericPredicates <' tcx>>)
91
93
cache_on_disk_if { key. is_local( ) }
92
94
}
93
95
@@ -586,23 +588,29 @@ rustc_queries! {
586
588
cache_on_disk_if { true }
587
589
}
588
590
589
- query def_kind( _: DefId ) -> Option <DefKind > { }
591
+ query def_kind( _: DefId ) -> Option <DefKind > {
592
+ storage( caches:: LocalDenseDefIdCacheSelector <Option <DefKind >>)
593
+ }
590
594
query def_span( _: DefId ) -> Span {
595
+ storage( caches:: LocalDenseDefIdCacheSelector <Span >)
591
596
// FIXME(mw): DefSpans are not really inputs since they are derived from
592
597
// HIR. But at the moment HIR hashing still contains some hacks that allow
593
598
// to make type debuginfo to be source location independent. Declaring
594
599
// DefSpan an input makes sure that changes to these are always detected
595
600
// regardless of HIR hashing.
596
601
eval_always
597
602
}
598
- query lookup_stability( _: DefId ) -> Option <& ' tcx attr:: Stability > { }
603
+ query lookup_stability( _: DefId ) -> Option <& ' tcx attr:: Stability > {
604
+ storage( caches:: LocalDenseDefIdCacheSelector <Option <& ' tcx attr:: Stability >>)
605
+ }
599
606
query lookup_const_stability( _: DefId ) -> Option <& ' tcx attr:: ConstStability > { }
600
607
query lookup_deprecation_entry( _: DefId ) -> Option <DeprecationEntry > { }
601
608
query item_attrs( _: DefId ) -> Lrc <[ ast:: Attribute ] > { }
602
609
}
603
610
604
611
Codegen {
605
612
query codegen_fn_attrs( _: DefId ) -> CodegenFnAttrs {
613
+ storage( caches:: LocalDenseDefIdCacheSelector <CodegenFnAttrs >)
606
614
cache_on_disk_if { true }
607
615
}
608
616
}
@@ -664,7 +672,9 @@ rustc_queries! {
664
672
/// associated types. This is almost always what you want,
665
673
/// unless you are doing MIR optimizations, in which case you
666
674
/// might want to use `reveal_all()` method to change modes.
667
- query param_env( _: DefId ) -> ty:: ParamEnv <' tcx> { }
675
+ query param_env( _: DefId ) -> ty:: ParamEnv <' tcx> {
676
+ storage( caches:: LocalDenseDefIdCacheSelector <ty:: ParamEnv <' tcx>>)
677
+ }
668
678
669
679
/// Trait selection queries. These are best used by invoking `ty.is_copy_modulo_regions()`,
670
680
/// `ty.is_copy()`, etc, since that will prune the environment where possible.
0 commit comments