diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2020-03-19 13:15:34 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2020-03-26 09:22:45 +0100 |
| commit | 42f0db59873ab47d5c8a00620e94bea63dea35a0 (patch) | |
| tree | 7c84c7c523f32d2724efe2a5fd8fd9de974aad2b /src/librustc | |
| parent | 63087b6b15bff0346fda199e1a077ab3cdc30ba3 (diff) | |
| download | rust-42f0db59873ab47d5c8a00620e94bea63dea35a0.tar.gz rust-42f0db59873ab47d5c8a00620e94bea63dea35a0.zip | |
Move HashStable bound to the trait definition.
Diffstat (limited to 'src/librustc')
| -rw-r--r-- | src/librustc/ty/query/config.rs | 3 | ||||
| -rw-r--r-- | src/librustc/ty/query/job.rs | 11 |
2 files changed, 4 insertions, 10 deletions
diff --git a/src/librustc/ty/query/config.rs b/src/librustc/ty/query/config.rs index 9495d9bfc6b..04662986702 100644 --- a/src/librustc/ty/query/config.rs +++ b/src/librustc/ty/query/config.rs @@ -10,6 +10,7 @@ use rustc_hir::def_id::DefId; 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; @@ -25,7 +26,7 @@ pub trait QueryConfig<CTX> { } pub trait QueryContext: DepContext { - type Query: Clone; + type Query: Clone + HashStable<Self::StableHashingContext>; /// Access the session. fn session(&self) -> &Session; diff --git a/src/librustc/ty/query/job.rs b/src/librustc/ty/query/job.rs index 253c814588f..7f0156abdea 100644 --- a/src/librustc/ty/query/job.rs +++ b/src/librustc/ty/query/job.rs @@ -405,7 +405,6 @@ fn connected_to_root<CTX: QueryContext>( 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 @@ -437,10 +436,7 @@ fn remove_cycle<CTX: QueryContext>( 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` @@ -564,10 +560,7 @@ pub unsafe fn handle_deadlock() { /// 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(); |
