use rustc_data_structures::fingerprint::Fingerprint;
use rustc_data_structures::fx::FxHashMap;
+use rustc_data_structures::stable_hasher::HashStable;
use rustc_query_system::dep_graph::{DepContext, DepNode};
use rustc_session::Session;
use std::borrow::Cow;
}
pub trait QueryContext: DepContext {
- type Query: Clone;
+ type Query: Clone + HashStable<Self::StableHashingContext>;
/// Access the session.
fn session(&self) -> &Session;
fn pick_query<'a, CTX, T, F>(query_map: &QueryMap<CTX>, tcx: CTX, queries: &'a [T], f: F) -> &'a T
where
CTX: QueryContext,
- CTX::Query: HashStable<CTX::StableHashingContext>,
F: Fn(&T) -> (Span, QueryJobId<CTX::DepKind>),
{
// Deterministically pick an entry point
jobs: &mut Vec<QueryJobId<CTX::DepKind>>,
wakelist: &mut Vec<Lrc<QueryWaiter<CTX>>>,
tcx: CTX,
-) -> bool
-where
- CTX::Query: HashStable<CTX::StableHashingContext>,
-{
+) -> bool {
let mut visited = FxHashSet::default();
let mut stack = Vec::new();
// Look for a cycle starting with the last query in `jobs`
/// There may be multiple cycles involved in a deadlock, so this searches
/// all active queries for cycles before finally resuming all the waiters at once.
#[cfg(parallel_compiler)]
-fn deadlock<CTX: QueryContext>(tcx: CTX, registry: &rayon_core::Registry)
-where
- CTX::Query: HashStable<CTX::StableHashingContext>,
-{
+fn deadlock<CTX: QueryContext>(tcx: CTX, registry: &rayon_core::Registry) {
let on_panic = OnDrop(|| {
eprintln!("deadlock handler panicked, aborting process");
process::abort();