Skip to content

Commit c84fae1

Browse files
committed
Move the definition of QueryResult into plumbing.rs.
Because it's the only file that uses it, and removes the need for importing it.
1 parent 0f0c640 commit c84fae1

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

src/librustc/ty/query/job.rs

-10
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ use {
2222
std::iter::FromIterator,
2323
};
2424

25-
/// Indicates the state of a query for a given key in a query map.
26-
pub(super) enum QueryResult<'tcx> {
27-
/// An already executing query. The query job can be used to await for its completion.
28-
Started(Lrc<QueryJob<'tcx>>),
29-
30-
/// The query panicked. Queries trying to wait on this will raise a fatal error or
31-
/// silently panic.
32-
Poisoned,
33-
}
34-
3525
/// Represents a span and a query key.
3626
#[derive(Clone, Debug)]
3727
pub struct QueryInfo<'tcx> {

src/librustc/ty/query/plumbing.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::ty::tls;
77
use crate::ty::{self, TyCtxt};
88
use crate::ty::query::Query;
99
use crate::ty::query::config::{QueryConfig, QueryDescription};
10-
use crate::ty::query::job::{QueryJob, QueryResult, QueryInfo};
10+
use crate::ty::query::job::{QueryJob, QueryInfo};
1111

1212
use errors::DiagnosticBuilder;
1313
use 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+
5565
impl<'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

Comments
 (0)