@@ -51,7 +51,7 @@ pub(super) trait QueryDescription<'tcx>: QueryAccessors<'tcx> {
51
51
fn describe ( tcx : TyCtxt < ' _ , ' _ , ' _ > , key : Self :: Key ) -> Cow < ' static , str > ;
52
52
53
53
#[ inline]
54
- fn cache_on_disk ( _: Self :: Key ) -> bool {
54
+ fn cache_on_disk ( _: TyCtxt < ' _ , ' tcx , ' tcx > , _ : Self :: Key ) -> bool {
55
55
false
56
56
}
57
57
@@ -387,7 +387,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::const_eval<'tcx> {
387
387
}
388
388
389
389
#[ inline]
390
- fn cache_on_disk ( _key : Self :: Key ) -> bool {
390
+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , _key : Self :: Key ) -> bool {
391
391
true
392
392
}
393
393
@@ -407,7 +407,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::const_eval_raw<'tcx> {
407
407
}
408
408
409
409
#[ inline]
410
- fn cache_on_disk ( _key : Self :: Key ) -> bool {
410
+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , _key : Self :: Key ) -> bool {
411
411
true
412
412
}
413
413
@@ -431,7 +431,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::symbol_name<'tcx> {
431
431
}
432
432
433
433
#[ inline]
434
- fn cache_on_disk ( _: Self :: Key ) -> bool {
434
+ fn cache_on_disk ( _: TyCtxt < ' _ , ' tcx , ' tcx > , _ : Self :: Key ) -> bool {
435
435
true
436
436
}
437
437
@@ -505,7 +505,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::const_is_rvalue_promotable_to_sta
505
505
}
506
506
507
507
#[ inline]
508
- fn cache_on_disk ( _: Self :: Key ) -> bool {
508
+ fn cache_on_disk ( _: TyCtxt < ' _ , ' tcx , ' tcx > , _ : Self :: Key ) -> bool {
509
509
true
510
510
}
511
511
@@ -539,7 +539,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::codegen_fulfill_obligation<'tcx>
539
539
}
540
540
541
541
#[ inline]
542
- fn cache_on_disk ( _: Self :: Key ) -> bool {
542
+ fn cache_on_disk ( _: TyCtxt < ' _ , ' tcx , ' tcx > , _ : Self :: Key ) -> bool {
543
543
true
544
544
}
545
545
@@ -877,7 +877,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::features_query<'tcx> {
877
877
878
878
impl < ' tcx > QueryDescription < ' tcx > for queries:: typeck_tables_of < ' tcx > {
879
879
#[ inline]
880
- fn cache_on_disk ( def_id : Self :: Key ) -> bool {
880
+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , def_id : Self :: Key ) -> bool {
881
881
def_id. is_local ( )
882
882
}
883
883
@@ -894,7 +894,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::typeck_tables_of<'tcx> {
894
894
895
895
impl < ' tcx > QueryDescription < ' tcx > for queries:: optimized_mir < ' tcx > {
896
896
#[ inline]
897
- fn cache_on_disk ( def_id : Self :: Key ) -> bool {
897
+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , def_id : Self :: Key ) -> bool {
898
898
def_id. is_local ( )
899
899
}
900
900
@@ -933,7 +933,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::instance_def_size_estimate<'tcx>
933
933
934
934
impl < ' tcx > QueryDescription < ' tcx > for queries:: generics_of < ' tcx > {
935
935
#[ inline]
936
- fn cache_on_disk ( def_id : Self :: Key ) -> bool {
936
+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , def_id : Self :: Key ) -> bool {
937
937
def_id. is_local ( )
938
938
}
939
939
@@ -983,10 +983,10 @@ impl<'tcx> QueryDescription<'tcx> for queries::backend_optimization_level<'tcx>
983
983
}
984
984
985
985
macro_rules! impl_disk_cacheable_query(
986
- ( $query_name: ident, |$key: tt| $cond: expr) => {
986
+ ( $query_name: ident, |$tcx : tt , $ key: tt| $cond: expr) => {
987
987
impl <' tcx> QueryDescription <' tcx> for queries:: $query_name<' tcx> {
988
988
#[ inline]
989
- fn cache_on_disk( $key: Self :: Key ) -> bool {
989
+ fn cache_on_disk( $tcx : TyCtxt < ' _ , ' tcx , ' tcx> , $ key: Self :: Key ) -> bool {
990
990
$cond
991
991
}
992
992
@@ -1000,14 +1000,17 @@ macro_rules! impl_disk_cacheable_query(
1000
1000
}
1001
1001
) ;
1002
1002
1003
- impl_disk_cacheable_query ! ( unsafety_check_result, |def_id| def_id. is_local( ) ) ;
1004
- impl_disk_cacheable_query ! ( borrowck, |def_id| def_id. is_local( ) ) ;
1005
- impl_disk_cacheable_query ! ( mir_borrowck, |def_id| def_id. is_local( ) ) ;
1006
- impl_disk_cacheable_query ! ( mir_const_qualif, |def_id| def_id. is_local( ) ) ;
1007
- impl_disk_cacheable_query ! ( check_match, |def_id| def_id. is_local( ) ) ;
1008
- impl_disk_cacheable_query ! ( def_symbol_name, |_| true ) ;
1009
- impl_disk_cacheable_query ! ( type_of, |def_id| def_id. is_local( ) ) ;
1010
- impl_disk_cacheable_query ! ( predicates_of, |def_id| def_id. is_local( ) ) ;
1011
- impl_disk_cacheable_query ! ( used_trait_imports, |def_id| def_id. is_local( ) ) ;
1012
- impl_disk_cacheable_query ! ( codegen_fn_attrs, |_| true ) ;
1013
- impl_disk_cacheable_query ! ( specialization_graph_of, |_| true ) ;
1003
+ impl_disk_cacheable_query ! ( mir_borrowck, |tcx, def_id| {
1004
+ def_id. is_local( ) && tcx. is_closure( def_id)
1005
+ } ) ;
1006
+
1007
+ impl_disk_cacheable_query ! ( unsafety_check_result, |_, def_id| def_id. is_local( ) ) ;
1008
+ impl_disk_cacheable_query ! ( borrowck, |_, def_id| def_id. is_local( ) ) ;
1009
+ impl_disk_cacheable_query ! ( mir_const_qualif, |_, def_id| def_id. is_local( ) ) ;
1010
+ impl_disk_cacheable_query ! ( check_match, |_, def_id| def_id. is_local( ) ) ;
1011
+ impl_disk_cacheable_query ! ( def_symbol_name, |_, _| true ) ;
1012
+ impl_disk_cacheable_query ! ( type_of, |_, def_id| def_id. is_local( ) ) ;
1013
+ impl_disk_cacheable_query ! ( predicates_of, |_, def_id| def_id. is_local( ) ) ;
1014
+ impl_disk_cacheable_query ! ( used_trait_imports, |_, def_id| def_id. is_local( ) ) ;
1015
+ impl_disk_cacheable_query ! ( codegen_fn_attrs, |_, _| true ) ;
1016
+ impl_disk_cacheable_query ! ( specialization_graph_of, |_, _| true ) ;
0 commit comments