@@ -7,7 +7,7 @@ use crate::ty::tls;
7
7
use crate :: ty:: { self , TyCtxt } ;
8
8
use crate :: ty:: query:: Query ;
9
9
use crate :: ty:: query:: config:: { QueryConfig , QueryDescription } ;
10
- use crate :: ty:: query:: job:: { QueryJob , QueryResult , QueryInfo } ;
10
+ use crate :: ty:: query:: job:: { QueryJob , QueryInfo } ;
11
11
12
12
use errors:: DiagnosticBuilder ;
13
13
use errors:: Level ;
@@ -52,6 +52,16 @@ impl<T> QueryValue<T> {
52
52
}
53
53
}
54
54
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
+
55
65
impl < ' tcx , M : QueryConfig < ' tcx > > Default for QueryCache < ' tcx , M > {
56
66
fn default ( ) -> QueryCache < ' tcx , M > {
57
67
QueryCache {
@@ -676,8 +686,6 @@ macro_rules! define_queries_inner {
676
686
[ $( $modifiers: tt) * ] fn $name: ident: $node: ident( $K: ty) -> $V: ty, ) * ) => {
677
687
678
688
use std:: mem;
679
- #[ cfg( parallel_compiler) ]
680
- use ty:: query:: job:: QueryResult ;
681
689
use rustc_data_structures:: sharded:: Sharded ;
682
690
use crate :: {
683
691
rustc_data_structures:: stable_hasher:: HashStable ,
0 commit comments