diff --git a/src/librustc/query/mod.rs b/src/librustc/query/mod.rs index d0ad2c90668a5..43d27138effe1 100644 --- a/src/librustc/query/mod.rs +++ b/src/librustc/query/mod.rs @@ -132,9 +132,9 @@ rustc_queries! { // is not a good candidates for "replay" because it is essentially a // pure function of its input (and hence the expectation is that // no caller would be green **apart** from just these - // queries). Making it anonymous avoids hashing the result, which + // queries). Making it no_hash avoids hashing the result, which // may save a bit of time. - anon + no_hash no_force desc { "erasing regions from `{:?}`", ty } } diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index 7dc4dee3fbf91..cd1f1895f68f7 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -2750,8 +2750,14 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { pub fn intern_existential_predicates(self, eps: &[ExistentialPredicate<'tcx>]) -> &'tcx List> { - assert!(!eps.is_empty()); - assert!(eps.windows(2).all(|w| w[0].stable_cmp(self, &w[1]) != Ordering::Greater)); + if cfg!(debug_assertions) { + assert!(!eps.is_empty()); + self.dep_graph.with_ignore(|| { + assert!(eps.windows(2).all(|w| { + w[0].stable_cmp(self, &w[1]) != Ordering::Greater + })); + }); + } self._intern_existential_predicates(eps) } diff --git a/src/librustc/ty/query/on_disk_cache.rs b/src/librustc/ty/query/on_disk_cache.rs index 28cf3f5245ef8..a40a04327e513 100644 --- a/src/librustc/ty/query/on_disk_cache.rs +++ b/src/librustc/ty/query/on_disk_cache.rs @@ -366,22 +366,6 @@ impl<'sess> OnDiskCache<'sess> { "query result") } - /// Stores a diagnostic emitted during computation of an anonymous query. - /// Since many anonymous queries can share the same `DepNode`, we aggregate - /// them -- as opposed to regular queries where we assume that there is a - /// 1:1 relationship between query-key and `DepNode`. - #[inline(never)] - #[cold] - pub fn store_diagnostics_for_anon_node(&self, - dep_node_index: DepNodeIndex, - diagnostics: ThinVec) { - let mut current_diagnostics = self.current_diagnostics.borrow_mut(); - - let x = current_diagnostics.entry(dep_node_index).or_insert(Vec::new()); - - x.extend(Into::>::into(diagnostics)); - } - fn load_indexed<'tcx, T>(&self, tcx: TyCtxt<'_, 'tcx, 'tcx>, dep_node_index: SerializedDepNodeIndex, diff --git a/src/librustc/ty/query/plumbing.rs b/src/librustc/ty/query/plumbing.rs index d671b58470c6a..a4857e2e95071 100644 --- a/src/librustc/ty/query/plumbing.rs +++ b/src/librustc/ty/query/plumbing.rs @@ -387,33 +387,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { let dep_node = Q::to_dep_node(self, &key); - if dep_node.kind.is_anon() { - profq_msg!(self, ProfileQueriesMsg::ProviderBegin); - self.sess.profiler(|p| p.start_query(Q::NAME)); - - let ((result, dep_node_index), diagnostics) = with_diagnostics(|diagnostics| { - self.start_query(job.job.clone(), diagnostics, |tcx| { - tcx.dep_graph.with_anon_task(dep_node.kind, || { - Q::compute(tcx.global_tcx(), key) - }) - }) - }); - - self.sess.profiler(|p| p.end_query(Q::NAME)); - profq_msg!(self, ProfileQueriesMsg::ProviderEnd); - - self.dep_graph.read_index(dep_node_index); - - if unlikely!(!diagnostics.is_empty()) { - self.queries.on_disk_cache - .store_diagnostics_for_anon_node(dep_node_index, diagnostics); - } - - job.complete(&result, dep_node_index); - - return result; - } - if !dep_node.kind.is_eval_always() { // The diagnostics for this query will be // promoted to the current session during @@ -606,8 +579,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { return; } - // Ensuring an anonymous query makes no sense - assert!(!dep_node.kind.is_anon()); if self.dep_graph.try_mark_green_and_read(self, &dep_node).is_none() { // A None return from `try_mark_green_and_read` means that this is either // a new dep node or that the dep node has already been marked red. diff --git a/src/librustc_macros/src/query.rs b/src/librustc_macros/src/query.rs index e4a6dfcd4e85e..2c0145271d8e3 100644 --- a/src/librustc_macros/src/query.rs +++ b/src/librustc_macros/src/query.rs @@ -52,9 +52,6 @@ enum QueryModifier { /// Don't force the query NoForce, - /// Generate a dep node based on the dependencies of the query - Anon, - // Always evaluate the query, ignoring its depdendencies EvalAlways, } @@ -110,8 +107,6 @@ impl Parse for QueryModifier { Ok(QueryModifier::NoHash) } else if modifier == "no_force" { Ok(QueryModifier::NoForce) - } else if modifier == "anon" { - Ok(QueryModifier::Anon) } else if modifier == "eval_always" { Ok(QueryModifier::EvalAlways) } else { @@ -221,9 +216,6 @@ struct QueryModifiers { /// Don't force the query no_force: bool, - /// Generate a dep node based on the dependencies of the query - anon: bool, - // Always evaluate the query, ignoring its depdendencies eval_always: bool, } @@ -237,7 +229,6 @@ fn process_modifiers(query: &mut Query) -> QueryModifiers { let mut cycle_delay_bug = false; let mut no_hash = false; let mut no_force = false; - let mut anon = false; let mut eval_always = false; for modifier in query.modifiers.0.drain(..) { match modifier { @@ -283,12 +274,6 @@ fn process_modifiers(query: &mut Query) -> QueryModifiers { } no_force = true; } - QueryModifier::Anon => { - if anon { - panic!("duplicate modifier `anon` for query `{}`", query.name); - } - anon = true; - } QueryModifier::EvalAlways => { if eval_always { panic!("duplicate modifier `eval_always` for query `{}`", query.name); @@ -305,7 +290,6 @@ fn process_modifiers(query: &mut Query) -> QueryModifiers { cycle_delay_bug, no_hash, no_force, - anon, eval_always, } } @@ -437,10 +421,6 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream { let mut attributes = Vec::new(); - // Pass on the anon modifier - if modifiers.anon { - attributes.push(quote! { anon }); - }; // Pass on the eval_always modifier if modifiers.eval_always { attributes.push(quote! { eval_always });