2017-09-18 05:40:13 -04:00
|
|
|
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2017-11-14 19:52:49 +01:00
|
|
|
use dep_graph::SerializedDepNodeIndex;
|
2018-04-19 02:33:24 +02:00
|
|
|
use dep_graph::DepNode;
|
2017-09-18 05:40:13 -04:00
|
|
|
use hir::def_id::{CrateNum, DefId, DefIndex};
|
2018-06-25 20:53:02 +02:00
|
|
|
use mir::interpret::GlobalId;
|
2018-06-11 10:33:37 -04:00
|
|
|
use traits::query::{
|
|
|
|
CanonicalPredicateGoal, CanonicalProjectionGoal, CanonicalTyGoal, CanonicalTypeOpEqGoal,
|
2018-06-11 11:56:06 -04:00
|
|
|
CanonicalTypeOpNormalizeGoal, CanonicalTypeOpProvePredicateGoal, CanonicalTypeOpSubtypeGoal,
|
2018-06-11 10:33:37 -04:00
|
|
|
};
|
2018-02-21 11:24:13 -05:00
|
|
|
use ty::{self, ParamEnvAnd, Ty, TyCtxt};
|
2017-09-18 05:40:13 -04:00
|
|
|
use ty::subst::Substs;
|
2018-06-13 16:44:43 +03:00
|
|
|
use ty::query::queries;
|
|
|
|
use ty::query::Query;
|
|
|
|
use ty::query::QueryCache;
|
2018-05-19 13:50:58 -04:00
|
|
|
use util::profiling::ProfileCategory;
|
2017-09-18 05:40:13 -04:00
|
|
|
|
|
|
|
use std::hash::Hash;
|
2018-04-19 02:33:24 +02:00
|
|
|
use std::fmt::Debug;
|
2017-09-18 05:40:13 -04:00
|
|
|
use syntax_pos::symbol::InternedString;
|
2018-04-18 04:35:40 +02:00
|
|
|
use rustc_data_structures::sync::Lock;
|
2018-04-19 02:33:24 +02:00
|
|
|
use rustc_data_structures::stable_hasher::HashStable;
|
|
|
|
use ich::StableHashingContext;
|
2017-09-18 05:40:13 -04:00
|
|
|
|
2018-06-13 16:44:43 +03:00
|
|
|
// Query configuration and description traits.
|
2017-09-18 05:40:13 -04:00
|
|
|
|
2018-04-18 04:35:40 +02:00
|
|
|
pub trait QueryConfig<'tcx> {
|
2018-04-19 02:33:24 +02:00
|
|
|
const NAME: &'static str;
|
2018-05-19 13:50:58 -04:00
|
|
|
const CATEGORY: ProfileCategory;
|
2018-04-19 02:33:24 +02:00
|
|
|
|
|
|
|
type Key: Eq + Hash + Clone + Debug;
|
|
|
|
type Value: Clone + for<'a> HashStable<StableHashingContext<'a>>;
|
2018-06-13 16:44:43 +03:00
|
|
|
}
|
2018-04-18 04:35:40 +02:00
|
|
|
|
2018-06-13 16:44:43 +03:00
|
|
|
pub(super) trait QueryAccessors<'tcx>: QueryConfig<'tcx> {
|
2018-04-18 04:35:40 +02:00
|
|
|
fn query(key: Self::Key) -> Query<'tcx>;
|
2018-04-27 12:08:54 +02:00
|
|
|
|
|
|
|
// Don't use this method to access query results, instead use the methods on TyCtxt
|
2018-06-13 16:44:43 +03:00
|
|
|
fn query_cache<'a>(tcx: TyCtxt<'a, 'tcx, '_>) -> &'a Lock<QueryCache<'tcx, Self>>;
|
2018-04-19 02:33:24 +02:00
|
|
|
|
|
|
|
fn to_dep_node(tcx: TyCtxt<'_, 'tcx, '_>, key: &Self::Key) -> DepNode;
|
|
|
|
|
2018-04-27 12:08:54 +02:00
|
|
|
// Don't use this method to compute query results, instead use the methods on TyCtxt
|
2018-04-19 02:33:24 +02:00
|
|
|
fn compute(tcx: TyCtxt<'_, 'tcx, '_>, key: Self::Key) -> Self::Value;
|
|
|
|
|
|
|
|
fn handle_cycle_error(tcx: TyCtxt<'_, 'tcx, '_>) -> Self::Value;
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
|
2018-06-13 16:44:43 +03:00
|
|
|
pub(super) trait QueryDescription<'tcx>: QueryAccessors<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(tcx: TyCtxt, key: Self::Key) -> String;
|
2017-11-14 19:52:49 +01:00
|
|
|
|
2017-12-04 20:08:25 +01:00
|
|
|
#[inline]
|
2017-11-14 19:52:49 +01:00
|
|
|
fn cache_on_disk(_: Self::Key) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
2017-11-29 12:42:59 +01:00
|
|
|
fn try_load_from_disk(_: TyCtxt<'_, 'tcx, 'tcx>,
|
|
|
|
_: SerializedDepNodeIndex)
|
|
|
|
-> Option<Self::Value> {
|
2017-12-04 20:08:25 +01:00
|
|
|
bug!("QueryDescription::load_from_disk() called for an unsupported query.")
|
2017-11-14 19:52:49 +01:00
|
|
|
}
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
|
2018-06-13 16:44:43 +03:00
|
|
|
impl<'tcx, M: QueryAccessors<'tcx, Key=DefId>> QueryDescription<'tcx> for M {
|
2017-09-18 05:40:13 -04:00
|
|
|
default fn describe(tcx: TyCtxt, def_id: DefId) -> String {
|
2017-09-11 13:09:14 -04:00
|
|
|
if !tcx.sess.verbose() {
|
|
|
|
format!("processing `{}`", tcx.item_path_str(def_id))
|
|
|
|
} else {
|
|
|
|
let name = unsafe { ::std::intrinsics::type_name::<M>() };
|
|
|
|
format!("processing `{}` applied to `{:?}`", name, def_id)
|
|
|
|
}
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-25 10:58:54 -05:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::normalize_projection_ty<'tcx> {
|
|
|
|
fn describe(
|
|
|
|
_tcx: TyCtxt,
|
|
|
|
goal: CanonicalProjectionGoal<'tcx>,
|
|
|
|
) -> String {
|
|
|
|
format!("normalizing `{:?}`", goal)
|
2018-02-21 10:55:16 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-04 13:07:45 -05:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::implied_outlives_bounds<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, goal: CanonicalTyGoal<'tcx>) -> String {
|
|
|
|
format!("computing implied outlives bounds for `{:?}`", goal)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-21 10:55:16 -05:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::dropck_outlives<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, goal: CanonicalTyGoal<'tcx>) -> String {
|
|
|
|
format!("computing dropck types for `{:?}`", goal)
|
2018-02-21 11:24:13 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::normalize_ty_after_erasing_regions<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, goal: ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
|
|
|
|
format!("normalizing `{:?}`", goal)
|
2018-02-25 10:58:54 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-08 18:30:37 -06:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::evaluate_obligation<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, goal: CanonicalPredicateGoal<'tcx>) -> String {
|
|
|
|
format!("evaluating trait selection obligation `{}`", goal.value.value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-11 10:33:37 -04:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::type_op_eq<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, goal: CanonicalTypeOpEqGoal<'tcx>) -> String {
|
|
|
|
format!("evaluating `type_op_eq` `{:?}`", goal)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-11 10:50:16 -04:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::type_op_subtype<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, goal: CanonicalTypeOpSubtypeGoal<'tcx>) -> String {
|
2018-06-27 06:57:20 -04:00
|
|
|
format!("evaluating `type_op_subtype` `{:?}`", goal)
|
2018-06-11 10:50:16 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-11 11:29:46 -04:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::type_op_prove_predicate<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, goal: CanonicalTypeOpProvePredicateGoal<'tcx>) -> String {
|
|
|
|
format!("evaluating `type_op_prove_predicate` `{:?}`", goal)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-11 11:56:06 -04:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::type_op_normalize_ty<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, goal: CanonicalTypeOpNormalizeGoal<'tcx, Ty<'tcx>>) -> String {
|
|
|
|
format!("normalizing `{:?}`", goal)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::type_op_normalize_predicate<'tcx> {
|
|
|
|
fn describe(
|
|
|
|
_tcx: TyCtxt,
|
|
|
|
goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::Predicate<'tcx>>,
|
|
|
|
) -> String {
|
|
|
|
format!("normalizing `{:?}`", goal)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::type_op_normalize_poly_fn_sig<'tcx> {
|
|
|
|
fn describe(
|
|
|
|
_tcx: TyCtxt,
|
|
|
|
goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::PolyFnSig<'tcx>>,
|
|
|
|
) -> String {
|
|
|
|
format!("normalizing `{:?}`", goal)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::type_op_normalize_fn_sig<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::FnSig<'tcx>>) -> String {
|
|
|
|
format!("normalizing `{:?}`", goal)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::is_copy_raw<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
|
|
|
|
format!("computing whether `{}` is `Copy`", env.value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::is_sized_raw<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
|
|
|
|
format!("computing whether `{}` is `Sized`", env.value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::is_freeze_raw<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
|
|
|
|
format!("computing whether `{}` is freeze", env.value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::needs_drop_raw<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
|
|
|
|
format!("computing whether `{}` needs drop", env.value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::layout_raw<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
|
|
|
|
format!("computing layout of `{}`", env.value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::super_predicates_of<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(tcx: TyCtxt, def_id: DefId) -> String {
|
|
|
|
format!("computing the supertraits of `{}`",
|
|
|
|
tcx.item_path_str(def_id))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::erase_regions_ty<'tcx> {
|
2017-10-17 11:24:46 -04:00
|
|
|
fn describe(_tcx: TyCtxt, ty: Ty<'tcx>) -> String {
|
|
|
|
format!("erasing regions from `{:?}`", ty)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::type_param_predicates<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(tcx: TyCtxt, (_, def_id): (DefId, DefId)) -> String {
|
|
|
|
let id = tcx.hir.as_local_node_id(def_id).unwrap();
|
|
|
|
format!("computing the bounds for type parameter `{}`",
|
|
|
|
tcx.hir.ty_param_name(id))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::coherent_trait<'tcx> {
|
2017-12-20 16:45:23 +01:00
|
|
|
fn describe(tcx: TyCtxt, def_id: DefId) -> String {
|
2017-09-18 05:40:13 -04:00
|
|
|
format!("coherence checking all impls of trait `{}`",
|
|
|
|
tcx.item_path_str(def_id))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-06 10:33:42 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::upstream_monomorphizations<'tcx> {
|
|
|
|
fn describe(_: TyCtxt, k: CrateNum) -> String {
|
|
|
|
format!("collecting available upstream monomorphizations `{:?}`", k)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::crate_inherent_impls<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, k: CrateNum) -> String {
|
|
|
|
format!("all inherent impls defined in crate `{:?}`", k)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::crate_inherent_impls_overlap_check<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"check for overlap between inherent impls defined in this crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::crate_variances<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"computing the variances for items in this crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-15 01:13:56 -04:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::inferred_outlives_crate<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"computing the inferred outlives predicates for items in this crate".to_string()
|
2017-10-15 01:13:56 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::mir_shims<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(tcx: TyCtxt, def: ty::InstanceDef<'tcx>) -> String {
|
|
|
|
format!("generating MIR shim for `{}`",
|
|
|
|
tcx.item_path_str(def.def_id()))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::privacy_access_levels<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"privacy access levels".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::typeck_item_bodies<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"type-checking all item bodies".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::reachable_set<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"reachability".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::const_eval<'tcx> {
|
2018-01-02 23:22:09 +00:00
|
|
|
fn describe(tcx: TyCtxt, key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>) -> String {
|
|
|
|
format!("const-evaluating `{}`", tcx.item_path_str(key.value.instance.def.def_id()))
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
2018-03-09 07:09:24 +01:00
|
|
|
|
|
|
|
#[inline]
|
2018-03-13 16:21:54 +01:00
|
|
|
fn cache_on_disk(_key: Self::Key) -> bool {
|
|
|
|
true
|
2018-03-09 07:09:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
|
|
|
id: SerializedDepNodeIndex)
|
|
|
|
-> Option<Self::Value> {
|
2018-06-13 16:44:43 +03:00
|
|
|
tcx.queries.on_disk_cache.try_load_query_result(tcx, id).map(Ok)
|
2018-03-09 07:09:24 +01:00
|
|
|
}
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::mir_keys<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"getting a list of all mir_keys".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::symbol_name<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, instance: ty::Instance<'tcx>) -> String {
|
|
|
|
format!("computing the symbol for `{}`", instance)
|
|
|
|
}
|
2017-12-04 20:08:25 +01:00
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn cache_on_disk(_: Self::Key) -> bool {
|
|
|
|
true
|
|
|
|
}
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
|
|
|
id: SerializedDepNodeIndex)
|
|
|
|
-> Option<Self::Value> {
|
2018-06-13 16:44:43 +03:00
|
|
|
tcx.queries.on_disk_cache.try_load_query_result(tcx, id)
|
2017-12-04 20:08:25 +01:00
|
|
|
}
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::describe_def<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: DefId) -> String {
|
|
|
|
bug!("describe_def")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::def_span<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: DefId) -> String {
|
|
|
|
bug!("def_span")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::lookup_stability<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: DefId) -> String {
|
|
|
|
bug!("stability")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::lookup_deprecation_entry<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: DefId) -> String {
|
|
|
|
bug!("deprecation")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::item_attrs<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: DefId) -> String {
|
|
|
|
bug!("item_attrs")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-22 12:18:16 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::is_reachable_non_generic<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: DefId) -> String {
|
2018-02-22 12:18:16 +01:00
|
|
|
bug!("is_reachable_non_generic")
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::fn_arg_names<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: DefId) -> String {
|
|
|
|
bug!("fn_arg_names")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::impl_parent<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: DefId) -> String {
|
|
|
|
bug!("impl_parent")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::trait_of_item<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: DefId) -> String {
|
|
|
|
bug!("trait_of_item")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::const_is_rvalue_promotable_to_static<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(tcx: TyCtxt, def_id: DefId) -> String {
|
|
|
|
format!("const checking if rvalue is promotable to static `{}`",
|
|
|
|
tcx.item_path_str(def_id))
|
|
|
|
}
|
2017-12-04 20:08:25 +01:00
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn cache_on_disk(_: Self::Key) -> bool {
|
|
|
|
true
|
|
|
|
}
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
|
|
|
id: SerializedDepNodeIndex)
|
|
|
|
-> Option<Self::Value> {
|
2018-06-13 16:44:43 +03:00
|
|
|
tcx.queries.on_disk_cache.try_load_query_result(tcx, id)
|
2017-12-04 20:08:25 +01:00
|
|
|
}
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::rvalue_promotable_map<'tcx> {
|
2017-09-11 13:09:14 -04:00
|
|
|
fn describe(tcx: TyCtxt, def_id: DefId) -> String {
|
|
|
|
format!("checking which parts of `{}` are promotable to static",
|
|
|
|
tcx.item_path_str(def_id))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::is_mir_available<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(tcx: TyCtxt, def_id: DefId) -> String {
|
|
|
|
format!("checking if item is mir available: `{}`",
|
|
|
|
tcx.item_path_str(def_id))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-08 16:10:16 +03:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::codegen_fulfill_obligation<'tcx> {
|
2017-09-28 23:13:43 -04:00
|
|
|
fn describe(tcx: TyCtxt, key: (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>)) -> String {
|
|
|
|
format!("checking if `{}` fulfills its obligations", tcx.item_path_str(key.1.def_id()))
|
|
|
|
}
|
2017-12-04 20:08:25 +01:00
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn cache_on_disk(_: Self::Key) -> bool {
|
|
|
|
true
|
|
|
|
}
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
|
|
|
id: SerializedDepNodeIndex)
|
|
|
|
-> Option<Self::Value> {
|
2018-06-13 16:44:43 +03:00
|
|
|
tcx.queries.on_disk_cache.try_load_query_result(tcx, id)
|
2017-12-04 20:08:25 +01:00
|
|
|
}
|
2017-09-28 23:13:43 -04:00
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::trait_impls_of<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(tcx: TyCtxt, def_id: DefId) -> String {
|
|
|
|
format!("trait impls of `{}`", tcx.item_path_str(def_id))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::is_object_safe<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(tcx: TyCtxt, def_id: DefId) -> String {
|
|
|
|
format!("determine object safety of trait `{}`", tcx.item_path_str(def_id))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::is_const_fn<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(tcx: TyCtxt, def_id: DefId) -> String {
|
|
|
|
format!("checking if item is const fn: `{}`", tcx.item_path_str(def_id))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::dylib_dependency_formats<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: CrateNum) -> String {
|
|
|
|
"dylib dependency formats of crate".to_string()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::is_panic_runtime<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: CrateNum) -> String {
|
|
|
|
"checking if the crate is_panic_runtime".to_string()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::is_compiler_builtins<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: CrateNum) -> String {
|
|
|
|
"checking if the crate is_compiler_builtins".to_string()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::has_global_allocator<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: CrateNum) -> String {
|
|
|
|
"checking if the crate has_global_allocator".to_string()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::extern_crate<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_: TyCtxt, _: DefId) -> String {
|
|
|
|
"getting crate's ExternCrateData".to_string()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::lint_levels<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"computing the lint levels for items in this crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::specializes<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: (DefId, DefId)) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"computing whether impls specialize one another".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::in_scope_traits_map<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: DefIndex) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"traits in scope at a block".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::is_no_builtins<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"test whether a crate has #![no_builtins]".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::panic_strategy<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"query a crate's configured panic strategy".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::is_profiler_runtime<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"query a crate is #![profiler_runtime]".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::is_sanitizer_runtime<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"query a crate is #![sanitizer_runtime]".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-22 12:18:16 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::reachable_non_generics<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up the exported symbols of a crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::native_libraries<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up the native libraries of a linked crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-10 14:28:17 -08:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::foreign_modules<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up the foreign modules of a linked crate".to_string()
|
2018-02-10 14:28:17 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::plugin_registrar_fn<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up the plugin registrar for a crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::derive_registrar_fn<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up the derive registrar for a crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::crate_disambiguator<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up the disambiguator a crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::crate_hash<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up the hash a crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::original_crate_name<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up the original name a crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-13 11:58:53 -07:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::extra_filename<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up the extra filename for a crate".to_string()
|
2018-03-13 11:58:53 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::implementations_of_trait<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: (CrateNum, DefId)) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up implementations of a trait in a crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::all_trait_implementations<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up all (?) trait implementations".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::link_args<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up link arguments for a crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-23 08:05:58 -05:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::resolve_lifetimes<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"resolving lifetimes".to_string()
|
2017-11-23 08:05:58 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::named_region_map<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: DefIndex) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up a named region".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::is_late_bound_map<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: DefIndex) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"testing if a region is late bound".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::object_lifetime_defaults_map<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: DefIndex) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up lifetime defaults for a region".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::dep_kind<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"fetching what a dependency looks like".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::crate_name<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"fetching what a crate is named".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-23 01:20:33 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::get_lib_features<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
|
|
|
format!("calculating the lib features map")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::defined_lib_features<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
|
|
|
format!("calculating the lib features defined in a crate")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::get_lang_items<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"calculating the lang items map".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::defined_lang_items<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"calculating the lang items defined in a crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::missing_lang_items<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"calculating the missing lang items in a crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::visible_parent_map<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"calculating the visible parent map".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::missing_extern_crate_item<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"seeing if we're missing an `extern crate` item for this crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::used_crate_source<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking at the source for a crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::postorder_cnums<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"generating a postorder list of CrateNums".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::maybe_unused_extern_crates<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up all possibly unused extern crates".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::stability_index<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"calculating the stability index for the local crate".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-01 08:15:25 +02:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::all_traits<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"fetching all foreign and local traits".to_string()
|
2018-04-01 08:15:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::all_crate_nums<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"fetching all foreign CrateNum instances".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::exported_symbols<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"exported_symbols".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-08 16:10:16 +03:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::collect_and_partition_mono_items<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"collect_and_partition_mono_items".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::codegen_unit<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: InternedString) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"codegen_unit".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::output_filenames<'tcx> {
|
2017-09-18 05:40:13 -04:00
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"output_filenames".to_string()
|
2017-09-18 05:40:13 -04:00
|
|
|
}
|
|
|
|
}
|
2017-09-20 20:42:49 +02:00
|
|
|
|
2017-11-14 17:00:44 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::vtable_methods<'tcx> {
|
2017-10-07 16:55:09 -05:00
|
|
|
fn describe(tcx: TyCtxt, key: ty::PolyTraitRef<'tcx> ) -> String {
|
|
|
|
format!("finding all methods for trait {}", tcx.item_path_str(key.def_id()))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-14 16:11:02 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::features_query<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up enabled feature gates".to_string()
|
2018-02-14 16:11:02 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 19:52:49 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::typeck_tables_of<'tcx> {
|
|
|
|
#[inline]
|
|
|
|
fn cache_on_disk(def_id: Self::Key) -> bool {
|
|
|
|
def_id.is_local()
|
|
|
|
}
|
|
|
|
|
2017-11-29 12:42:59 +01:00
|
|
|
fn try_load_from_disk(tcx: TyCtxt<'_, 'tcx, 'tcx>,
|
|
|
|
id: SerializedDepNodeIndex)
|
|
|
|
-> Option<Self::Value> {
|
2017-11-28 17:32:28 +01:00
|
|
|
let typeck_tables: Option<ty::TypeckTables<'tcx>> = tcx
|
2018-06-13 16:44:43 +03:00
|
|
|
.queries.on_disk_cache
|
2017-11-28 17:32:28 +01:00
|
|
|
.try_load_query_result(tcx, id);
|
|
|
|
|
|
|
|
typeck_tables.map(|tables| tcx.alloc_tables(tables))
|
2017-11-14 19:52:49 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-04 20:08:25 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::optimized_mir<'tcx> {
|
|
|
|
#[inline]
|
|
|
|
fn cache_on_disk(def_id: Self::Key) -> bool {
|
|
|
|
def_id.is_local()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
2018-01-17 16:39:29 +01:00
|
|
|
id: SerializedDepNodeIndex)
|
|
|
|
-> Option<Self::Value> {
|
2018-06-13 16:44:43 +03:00
|
|
|
let mir: Option<::mir::Mir<'tcx>> = tcx.queries.on_disk_cache
|
2017-12-04 20:08:25 +01:00
|
|
|
.try_load_query_result(tcx, id);
|
|
|
|
mir.map(|x| tcx.alloc_mir(x))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-27 12:32:44 -05:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::substitute_normalize_and_test_predicates<'tcx> {
|
|
|
|
fn describe(tcx: TyCtxt, key: (DefId, &'tcx Substs<'tcx>)) -> String {
|
|
|
|
format!("testing substituted normalized predicates:`{}`", tcx.item_path_str(key.0))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-05 13:26:26 -08:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::target_features_whitelist<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"looking up the whitelist of target features".to_string()
|
2018-01-05 13:26:26 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-19 00:32:58 +00:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::instance_def_size_estimate<'tcx> {
|
|
|
|
fn describe(tcx: TyCtxt, def: ty::InstanceDef<'tcx>) -> String {
|
|
|
|
format!("estimating size for `{}`", tcx.item_path_str(def.def_id()))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-17 16:39:29 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::generics_of<'tcx> {
|
|
|
|
#[inline]
|
|
|
|
fn cache_on_disk(def_id: Self::Key) -> bool {
|
|
|
|
def_id.is_local()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
|
|
|
id: SerializedDepNodeIndex)
|
|
|
|
-> Option<Self::Value> {
|
2018-06-13 16:44:43 +03:00
|
|
|
let generics: Option<ty::Generics> = tcx.queries.on_disk_cache
|
2018-01-17 16:39:29 +01:00
|
|
|
.try_load_query_result(tcx, id);
|
|
|
|
generics.map(|x| tcx.alloc_generics(x))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-10 12:44:33 +01:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::program_clauses_for<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, _: DefId) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"generating chalk-style clauses".to_string()
|
2018-03-10 12:44:33 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-10 05:55:18 -04:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::program_clauses_for_env<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, _: ty::ParamEnv<'tcx>) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"generating chalk-style clauses for param env".to_string()
|
2018-04-10 05:55:18 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-10 14:28:17 -08:00
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::wasm_import_module_map<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"wasm import module map".to_string()
|
2018-02-10 14:28:17 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::dllimport_foreign_items<'tcx> {
|
|
|
|
fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
|
2018-07-28 14:40:32 +02:00
|
|
|
"wasm import module map".to_string()
|
2018-02-10 14:28:17 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-04 20:08:25 +01:00
|
|
|
macro_rules! impl_disk_cacheable_query(
|
|
|
|
($query_name:ident, |$key:tt| $cond:expr) => {
|
|
|
|
impl<'tcx> QueryDescription<'tcx> for queries::$query_name<'tcx> {
|
|
|
|
#[inline]
|
|
|
|
fn cache_on_disk($key: Self::Key) -> bool {
|
|
|
|
$cond
|
|
|
|
}
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
|
|
|
id: SerializedDepNodeIndex)
|
|
|
|
-> Option<Self::Value> {
|
2018-06-13 16:44:43 +03:00
|
|
|
tcx.queries.on_disk_cache.try_load_query_result(tcx, id)
|
2017-12-04 20:08:25 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
impl_disk_cacheable_query!(unsafety_check_result, |def_id| def_id.is_local());
|
|
|
|
impl_disk_cacheable_query!(borrowck, |def_id| def_id.is_local());
|
|
|
|
impl_disk_cacheable_query!(mir_borrowck, |def_id| def_id.is_local());
|
|
|
|
impl_disk_cacheable_query!(mir_const_qualif, |def_id| def_id.is_local());
|
2017-12-20 16:38:27 +01:00
|
|
|
impl_disk_cacheable_query!(check_match, |def_id| def_id.is_local());
|
2017-12-04 20:08:25 +01:00
|
|
|
impl_disk_cacheable_query!(def_symbol_name, |_| true);
|
2018-01-15 16:38:04 +01:00
|
|
|
impl_disk_cacheable_query!(type_of, |def_id| def_id.is_local());
|
|
|
|
impl_disk_cacheable_query!(predicates_of, |def_id| def_id.is_local());
|
|
|
|
impl_disk_cacheable_query!(used_trait_imports, |def_id| def_id.is_local());
|
2018-05-08 16:10:16 +03:00
|
|
|
impl_disk_cacheable_query!(codegen_fn_attrs, |_| true);
|
2018-03-13 21:36:49 -04:00
|
|
|
impl_disk_cacheable_query!(specialization_graph_of, |_| true);
|