@@ -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
@@ -136,6 +136,15 @@ impl<'tcx> QueryDescription<'tcx> for queries::check_mod_liveness<'tcx> {
136136 }
137137}
138138
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+
139148impl < ' tcx > QueryDescription < ' tcx > for queries:: collect_mod_item_types < ' tcx > {
140149 fn describe (
141150 tcx : TyCtxt < ' _ , ' _ , ' _ > ,
@@ -378,7 +387,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::const_eval<'tcx> {
378387 }
379388
380389 #[ inline]
381- fn cache_on_disk ( _key : Self :: Key ) -> bool {
390+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , _key : Self :: Key ) -> bool {
382391 true
383392 }
384393
@@ -398,7 +407,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::const_eval_raw<'tcx> {
398407 }
399408
400409 #[ inline]
401- fn cache_on_disk ( _key : Self :: Key ) -> bool {
410+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , _key : Self :: Key ) -> bool {
402411 true
403412 }
404413
@@ -422,7 +431,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::symbol_name<'tcx> {
422431 }
423432
424433 #[ inline]
425- fn cache_on_disk ( _: Self :: Key ) -> bool {
434+ fn cache_on_disk ( _: TyCtxt < ' _ , ' tcx , ' tcx > , _ : Self :: Key ) -> bool {
426435 true
427436 }
428437
@@ -496,7 +505,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::const_is_rvalue_promotable_to_sta
496505 }
497506
498507 #[ inline]
499- fn cache_on_disk ( _: Self :: Key ) -> bool {
508+ fn cache_on_disk ( _: TyCtxt < ' _ , ' tcx , ' tcx > , _ : Self :: Key ) -> bool {
500509 true
501510 }
502511
@@ -530,7 +539,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::codegen_fulfill_obligation<'tcx>
530539 }
531540
532541 #[ inline]
533- fn cache_on_disk ( _: Self :: Key ) -> bool {
542+ fn cache_on_disk ( _: TyCtxt < ' _ , ' tcx , ' tcx > , _ : Self :: Key ) -> bool {
534543 true
535544 }
536545
@@ -868,7 +877,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::features_query<'tcx> {
868877
869878impl < ' tcx > QueryDescription < ' tcx > for queries:: typeck_tables_of < ' tcx > {
870879 #[ inline]
871- fn cache_on_disk ( def_id : Self :: Key ) -> bool {
880+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , def_id : Self :: Key ) -> bool {
872881 def_id. is_local ( )
873882 }
874883
@@ -885,7 +894,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::typeck_tables_of<'tcx> {
885894
886895impl < ' tcx > QueryDescription < ' tcx > for queries:: optimized_mir < ' tcx > {
887896 #[ inline]
888- fn cache_on_disk ( def_id : Self :: Key ) -> bool {
897+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , def_id : Self :: Key ) -> bool {
889898 def_id. is_local ( )
890899 }
891900
@@ -924,7 +933,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::instance_def_size_estimate<'tcx>
924933
925934impl < ' tcx > QueryDescription < ' tcx > for queries:: generics_of < ' tcx > {
926935 #[ inline]
927- fn cache_on_disk ( def_id : Self :: Key ) -> bool {
936+ fn cache_on_disk ( _ : TyCtxt < ' _ , ' tcx , ' tcx > , def_id : Self :: Key ) -> bool {
928937 def_id. is_local ( )
929938 }
930939
@@ -974,10 +983,10 @@ impl<'tcx> QueryDescription<'tcx> for queries::backend_optimization_level<'tcx>
974983}
975984
976985macro_rules! impl_disk_cacheable_query(
977- ( $query_name: ident, |$key: tt| $cond: expr) => {
986+ ( $query_name: ident, |$tcx : tt , $ key: tt| $cond: expr) => {
978987 impl <' tcx> QueryDescription <' tcx> for queries:: $query_name<' tcx> {
979988 #[ inline]
980- fn cache_on_disk( $key: Self :: Key ) -> bool {
989+ fn cache_on_disk( $tcx : TyCtxt < ' _ , ' tcx , ' tcx> , $ key: Self :: Key ) -> bool {
981990 $cond
982991 }
983992
@@ -991,14 +1000,17 @@ macro_rules! impl_disk_cacheable_query(
9911000 }
9921001) ;
9931002
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