@@ -7,7 +7,7 @@ use crate::ty::tls;
77use crate :: ty:: { self , TyCtxt } ;
88use crate :: ty:: query:: Query ;
99use crate :: ty:: query:: config:: { QueryConfig , QueryDescription } ;
10- use crate :: ty:: query:: job:: { QueryJob , QueryResult , QueryInfo } ;
10+ use crate :: ty:: query:: job:: { QueryJob , QueryInfo } ;
1111
1212use errors:: DiagnosticBuilder ;
1313use errors:: Level ;
@@ -52,6 +52,16 @@ impl<T> QueryValue<T> {
5252 }
5353}
5454
55+ /// Indicates the state of a query for a given key in a query map.
56+ pub ( super ) enum QueryResult < ' tcx > {
57+ /// An already executing query. The query job can be used to await for its completion.
58+ Started ( Lrc < QueryJob < ' tcx > > ) ,
59+
60+ /// The query panicked. Queries trying to wait on this will raise a fatal error or
61+ /// silently panic.
62+ Poisoned ,
63+ }
64+
5565impl < ' tcx , M : QueryConfig < ' tcx > > Default for QueryCache < ' tcx , M > {
5666 fn default ( ) -> QueryCache < ' tcx , M > {
5767 QueryCache {
@@ -676,8 +686,6 @@ macro_rules! define_queries_inner {
676686 [ $( $modifiers: tt) * ] fn $name: ident: $node: ident( $K: ty) -> $V: ty, ) * ) => {
677687
678688 use std:: mem;
679- #[ cfg( parallel_compiler) ]
680- use ty:: query:: job:: QueryResult ;
681689 use rustc_data_structures:: sharded:: Sharded ;
682690 use crate :: {
683691 rustc_data_structures:: stable_hasher:: HashStable ,
0 commit comments