File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
compiler/rustc_query_system/src/query Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -300,7 +300,18 @@ where
300300 match result {
301301 Ok ( ( ) ) => {
302302 let Some ( ( v, index) ) = query. query_cache ( qcx) . lookup ( & key) else {
303- cold_path ( || panic ! ( "value must be in cache after waiting" ) )
303+ cold_path ( || {
304+ // We didn't find the query result in the query cache. Check if it was
305+ // poisoned due to a panic instead.
306+ let lock = query. query_state ( qcx) . active . get_shard_by_value ( & key) . lock ( ) ;
307+ match lock. get ( & key) {
308+ // The query we waited on panicked. Continue unwinding here.
309+ Some ( QueryResult :: Poisoned ) => FatalError . raise ( ) ,
310+ _ => panic ! (
311+ "query result must in the cache or the query must be poisoned after a wait"
312+ ) ,
313+ }
314+ } )
304315 } ;
305316
306317 qcx. dep_context ( ) . profiler ( ) . query_cache_hit ( index. into ( ) ) ;
You can’t perform that action at this time.
0 commit comments