@@ -51,7 +51,7 @@ pub(super) trait QueryDescription<'tcx>: QueryAccessors<'tcx> {
5151 fn describe ( tcx : TyCtxt < ' _ , ' _ , ' _ > , key : Self :: Key ) -> Cow < ' static , str > ;
5252
5353 #[ inline]
54- fn cache_on_disk ( _: Self :: Key ) -> bool {
54+ fn cache_on_disk ( _: TyCtxt < ' _ , ' tcx , ' tcx > , _ : Self :: Key ) -> bool {
5555 false
5656 }
5757
@@ -387,7 +387,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::const_eval<'tcx> {
387387 }
388388
389389 #[ inline]
390- fn cache_on_disk ( _key : Self :: Key ) -> bool {
390+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , _key : Self :: Key ) -> bool {
391391 true
392392 }
393393
@@ -407,7 +407,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::const_eval_raw<'tcx> {
407407 }
408408
409409 #[ inline]
410- fn cache_on_disk ( _key : Self :: Key ) -> bool {
410+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , _key : Self :: Key ) -> bool {
411411 true
412412 }
413413
@@ -431,7 +431,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::symbol_name<'tcx> {
431431 }
432432
433433 #[ inline]
434- fn cache_on_disk ( _: Self :: Key ) -> bool {
434+ fn cache_on_disk ( _: TyCtxt < ' _ , ' tcx , ' tcx > , _ : Self :: Key ) -> bool {
435435 true
436436 }
437437
@@ -505,7 +505,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::const_is_rvalue_promotable_to_sta
505505 }
506506
507507 #[ inline]
508- fn cache_on_disk ( _: Self :: Key ) -> bool {
508+ fn cache_on_disk ( _: TyCtxt < ' _ , ' tcx , ' tcx > , _ : Self :: Key ) -> bool {
509509 true
510510 }
511511
@@ -539,7 +539,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::codegen_fulfill_obligation<'tcx>
539539 }
540540
541541 #[ inline]
542- fn cache_on_disk ( _: Self :: Key ) -> bool {
542+ fn cache_on_disk ( _: TyCtxt < ' _ , ' tcx , ' tcx > , _ : Self :: Key ) -> bool {
543543 true
544544 }
545545
@@ -877,7 +877,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::features_query<'tcx> {
877877
878878impl < ' tcx > QueryDescription < ' tcx > for queries:: typeck_tables_of < ' tcx > {
879879 #[ inline]
880- fn cache_on_disk ( def_id : Self :: Key ) -> bool {
880+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , def_id : Self :: Key ) -> bool {
881881 def_id. is_local ( )
882882 }
883883
@@ -894,7 +894,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::typeck_tables_of<'tcx> {
894894
895895impl < ' tcx > QueryDescription < ' tcx > for queries:: optimized_mir < ' tcx > {
896896 #[ inline]
897- fn cache_on_disk ( def_id : Self :: Key ) -> bool {
897+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , def_id : Self :: Key ) -> bool {
898898 def_id. is_local ( )
899899 }
900900
@@ -933,7 +933,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::instance_def_size_estimate<'tcx>
933933
934934impl < ' tcx > QueryDescription < ' tcx > for queries:: generics_of < ' tcx > {
935935 #[ inline]
936- fn cache_on_disk ( def_id : Self :: Key ) -> bool {
936+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , def_id : Self :: Key ) -> bool {
937937 def_id. is_local ( )
938938 }
939939
@@ -983,10 +983,10 @@ impl<'tcx> QueryDescription<'tcx> for queries::backend_optimization_level<'tcx>
983983}
984984
985985macro_rules! impl_disk_cacheable_query(
986- ( $query_name: ident, |$key: tt| $cond: expr) => {
986+ ( $query_name: ident, |$tcx : tt , $ key: tt| $cond: expr) => {
987987 impl <' tcx> QueryDescription <' tcx> for queries:: $query_name<' tcx> {
988988 #[ inline]
989- fn cache_on_disk( $key: Self :: Key ) -> bool {
989+ fn cache_on_disk( $tcx : TyCtxt < ' _ , ' tcx , ' tcx> , $ key: Self :: Key ) -> bool {
990990 $cond
991991 }
992992
@@ -1000,14 +1000,17 @@ macro_rules! impl_disk_cacheable_query(
10001000 }
10011001) ;
10021002
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