@@ -276,15 +276,6 @@ fn wait_for_query<'tcx, C: QueryCache>(
276276 }
277277}
278278
279- fn execute_query_and_callback < ' tcx , R , C : QueryCache > (
280- tcx : TyCtxt < ' tcx > ,
281- query : & ' tcx QueryVTable < ' tcx , C > ,
282- action : impl FnOnce ( ) -> R ,
283- ) -> R {
284- query. callfront_fn . filter ( |_| !tcx. is_in_sandbox ( ) ) . inspect ( |f| ( f) ( tcx) ) ;
285- action ( )
286- }
287-
288279/// Shared main part of both [`execute_query_incr_inner`] and [`execute_query_non_incr_inner`].
289280#[ inline( never) ]
290281fn try_execute_query < ' tcx , C : QueryCache , const INCR : bool > (
@@ -633,9 +624,7 @@ pub(super) fn execute_query_non_incr_inner<'tcx, C: QueryCache>(
633624 span : Span ,
634625 key : C :: Key ,
635626) -> C :: Value {
636- execute_query_and_callback ( tcx, query, || {
637- ensure_sufficient_stack ( || try_execute_query :: < C , false > ( query, tcx, span, key, None ) . 0 )
638- } )
627+ ensure_sufficient_stack ( || try_execute_query :: < C , false > ( query, tcx, span, key, None ) . 0 )
639628}
640629
641630/// Called by a macro-generated impl of [`QueryVTable::execute_query_fn`],
@@ -657,16 +646,14 @@ pub(super) fn execute_query_incr_inner<'tcx, C: QueryCache>(
657646 return None ;
658647 }
659648
660- execute_query_and_callback ( tcx, query, || {
661- let ( result, dep_node_index) = ensure_sufficient_stack ( || {
662- try_execute_query :: < C , true > ( query, tcx, span, key, Some ( dep_node) )
663- } ) ;
664- if let Some ( dep_node_index) = dep_node_index {
665- tcx. dep_graph . read_index ( dep_node_index)
666- }
649+ let ( result, dep_node_index) = ensure_sufficient_stack ( || {
650+ try_execute_query :: < C , true > ( query, tcx, span, key, Some ( dep_node) )
651+ } ) ;
652+ if let Some ( dep_node_index) = dep_node_index {
653+ tcx. dep_graph . read_index ( dep_node_index)
654+ }
667655
668- Some ( result)
669- } )
656+ Some ( result)
670657}
671658
672659/// Inner implementation of [`DepKindVTable::force_from_dep_node_fn`][force_fn]
@@ -684,10 +671,9 @@ pub(crate) fn force_query_dep_node<'tcx, C: QueryCache>(
684671 return false ;
685672 } ;
686673
687- execute_query_and_callback ( tcx, query, || {
688- ensure_sufficient_stack ( || {
689- try_execute_query :: < C , true > ( query, tcx, DUMMY_SP , key, Some ( dep_node) )
690- } ) ;
674+ query. callfront_fn . filter ( |_| !tcx. is_in_sandbox ( ) ) . inspect ( |f| ( f) ( tcx) ) ;
675+ ensure_sufficient_stack ( || {
676+ try_execute_query :: < C , true > ( query, tcx, DUMMY_SP , key, Some ( dep_node) )
691677 } ) ;
692678
693679 // We did manage to recover a key and force the node, though it's up to
0 commit comments