@@ -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
@@ -136,6 +136,15 @@ impl<'tcx> QueryDescription<'tcx> for queries::check_mod_liveness<'tcx> {
136
136
}
137
137
}
138
138
139
+ impl < ' tcx > QueryDescription < ' tcx > for queries:: check_mod_impl_wf < ' tcx > {
140
+ fn describe (
141
+ tcx : TyCtxt < ' _ , ' _ , ' _ > ,
142
+ key : DefId ,
143
+ ) -> Cow < ' static , str > {
144
+ format ! ( "checking that impls are well-formed in {}" , key. describe_as_module( tcx) ) . into ( )
145
+ }
146
+ }
147
+
139
148
impl < ' tcx > QueryDescription < ' tcx > for queries:: collect_mod_item_types < ' tcx > {
140
149
fn describe (
141
150
tcx : TyCtxt < ' _ , ' _ , ' _ > ,
@@ -378,7 +387,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::const_eval<'tcx> {
378
387
}
379
388
380
389
#[ inline]
381
- fn cache_on_disk ( _key : Self :: Key ) -> bool {
390
+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , _key : Self :: Key ) -> bool {
382
391
true
383
392
}
384
393
@@ -398,7 +407,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::const_eval_raw<'tcx> {
398
407
}
399
408
400
409
#[ inline]
401
- fn cache_on_disk ( _key : Self :: Key ) -> bool {
410
+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , _key : Self :: Key ) -> bool {
402
411
true
403
412
}
404
413
@@ -422,7 +431,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::symbol_name<'tcx> {
422
431
}
423
432
424
433
#[ inline]
425
- fn cache_on_disk ( _: Self :: Key ) -> bool {
434
+ fn cache_on_disk ( _: TyCtxt < ' _ , ' tcx , ' tcx > , _ : Self :: Key ) -> bool {
426
435
true
427
436
}
428
437
@@ -496,7 +505,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::const_is_rvalue_promotable_to_sta
496
505
}
497
506
498
507
#[ inline]
499
- fn cache_on_disk ( _: Self :: Key ) -> bool {
508
+ fn cache_on_disk ( _: TyCtxt < ' _ , ' tcx , ' tcx > , _ : Self :: Key ) -> bool {
500
509
true
501
510
}
502
511
@@ -530,7 +539,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::codegen_fulfill_obligation<'tcx>
530
539
}
531
540
532
541
#[ inline]
533
- fn cache_on_disk ( _: Self :: Key ) -> bool {
542
+ fn cache_on_disk ( _: TyCtxt < ' _ , ' tcx , ' tcx > , _ : Self :: Key ) -> bool {
534
543
true
535
544
}
536
545
@@ -868,7 +877,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::features_query<'tcx> {
868
877
869
878
impl < ' tcx > QueryDescription < ' tcx > for queries:: typeck_tables_of < ' tcx > {
870
879
#[ inline]
871
- fn cache_on_disk ( def_id : Self :: Key ) -> bool {
880
+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , def_id : Self :: Key ) -> bool {
872
881
def_id. is_local ( )
873
882
}
874
883
@@ -885,7 +894,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::typeck_tables_of<'tcx> {
885
894
886
895
impl < ' tcx > QueryDescription < ' tcx > for queries:: optimized_mir < ' tcx > {
887
896
#[ inline]
888
- fn cache_on_disk ( def_id : Self :: Key ) -> bool {
897
+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , def_id : Self :: Key ) -> bool {
889
898
def_id. is_local ( )
890
899
}
891
900
@@ -924,7 +933,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::instance_def_size_estimate<'tcx>
924
933
925
934
impl < ' tcx > QueryDescription < ' tcx > for queries:: generics_of < ' tcx > {
926
935
#[ inline]
927
- fn cache_on_disk ( def_id : Self :: Key ) -> bool {
936
+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , def_id : Self :: Key ) -> bool {
928
937
def_id. is_local ( )
929
938
}
930
939
@@ -974,10 +983,10 @@ impl<'tcx> QueryDescription<'tcx> for queries::backend_optimization_level<'tcx>
974
983
}
975
984
976
985
macro_rules! impl_disk_cacheable_query(
977
- ( $query_name: ident, |$key: tt| $cond: expr) => {
986
+ ( $query_name: ident, |$tcx : tt , $ key: tt| $cond: expr) => {
978
987
impl <' tcx> QueryDescription <' tcx> for queries:: $query_name<' tcx> {
979
988
#[ inline]
980
- fn cache_on_disk( $key: Self :: Key ) -> bool {
989
+ fn cache_on_disk( $tcx : TyCtxt < ' _ , ' tcx , ' tcx> , $ key: Self :: Key ) -> bool {
981
990
$cond
982
991
}
983
992
@@ -991,14 +1000,17 @@ macro_rules! impl_disk_cacheable_query(
991
1000
}
992
1001
) ;
993
1002
994
- impl_disk_cacheable_query ! ( unsafety_check_result, |def_id| def_id. is_local( ) ) ;
995
- impl_disk_cacheable_query ! ( borrowck, |def_id| def_id. is_local( ) ) ;
996
- impl_disk_cacheable_query ! ( mir_borrowck, |def_id| def_id. is_local( ) ) ;
997
- impl_disk_cacheable_query ! ( mir_const_qualif, |def_id| def_id. is_local( ) ) ;
998
- impl_disk_cacheable_query ! ( check_match, |def_id| def_id. is_local( ) ) ;
999
- impl_disk_cacheable_query ! ( def_symbol_name, |_| true ) ;
1000
- impl_disk_cacheable_query ! ( type_of, |def_id| def_id. is_local( ) ) ;
1001
- impl_disk_cacheable_query ! ( predicates_of, |def_id| def_id. is_local( ) ) ;
1002
- impl_disk_cacheable_query ! ( used_trait_imports, |def_id| def_id. is_local( ) ) ;
1003
- impl_disk_cacheable_query ! ( codegen_fn_attrs, |_| true ) ;
1004
- 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