2015-12-22 16:39:33 -05: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-09-18 05:40:13 -04:00
|
|
|
use dep_graph::{DepConstructor, DepNode};
|
|
|
|
use hir::def_id::{CrateNum, DefId, DefIndex};
|
2017-08-29 11:10:22 -07:00
|
|
|
use hir::def::{Def, Export};
|
2018-05-08 16:10:16 +03:00
|
|
|
use hir::{self, TraitCandidate, ItemLocalId, CodegenFnAttrs};
|
2017-08-28 17:30:27 -07:00
|
|
|
use hir::svh::Svh;
|
2018-03-15 10:03:36 +01:00
|
|
|
use infer::canonical::{self, Canonical};
|
2017-07-26 21:51:09 -07:00
|
|
|
use lint;
|
2017-09-15 12:49:10 -07:00
|
|
|
use middle::borrowck::BorrowCheckResult;
|
2018-04-15 19:41:33 -04:00
|
|
|
use middle::cstore::{ExternCrate, LinkagePreference, NativeLibrary, ForeignModule};
|
|
|
|
use middle::cstore::{NativeLibraryKind, DepKind, CrateSource};
|
2017-03-23 15:13:29 -04:00
|
|
|
use middle::privacy::AccessLevels;
|
2017-08-14 18:19:42 +02:00
|
|
|
use middle::reachable::ReachableSet;
|
2017-08-31 21:37:38 +03:00
|
|
|
use middle::region;
|
2017-11-23 08:05:58 -05:00
|
|
|
use middle::resolve_lifetime::{ResolveLifetimes, Region, ObjectLifetimeDefault};
|
2017-08-31 15:08:34 -07:00
|
|
|
use middle::stability::{self, DeprecationEntry};
|
2017-08-31 09:19:33 -07:00
|
|
|
use middle::lang_items::{LanguageItems, LangItem};
|
2018-02-27 17:52:07 +01:00
|
|
|
use middle::exported_symbols::{SymbolExportLevel, ExportedSymbol};
|
2018-01-16 09:31:48 +01:00
|
|
|
use middle::const_val::EvalResult;
|
2017-10-27 10:50:39 +02:00
|
|
|
use mir::mono::{CodegenUnit, Stats};
|
2016-09-29 02:30:53 +03:00
|
|
|
use mir;
|
2018-04-26 09:18:19 +02:00
|
|
|
use mir::interpret::{GlobalId, Allocation, ConstValue};
|
2017-10-24 17:49:58 +02:00
|
|
|
use session::{CompileResult, CrateDisambiguator};
|
2017-09-13 20:26:39 -07:00
|
|
|
use session::config::OutputFilenames;
|
2018-03-08 18:30:37 -06:00
|
|
|
use traits::{self, Vtable};
|
|
|
|
use traits::query::{CanonicalPredicateGoal, CanonicalProjectionGoal,
|
|
|
|
CanonicalTyGoal, NoSolution};
|
2018-02-21 10:55:16 -05:00
|
|
|
use traits::query::dropck_outlives::{DtorckConstraint, DropckOutlivesResult};
|
2018-02-25 10:58:54 -05:00
|
|
|
use traits::query::normalize::NormalizationResult;
|
2017-05-11 16:01:19 +02:00
|
|
|
use traits::specialization_graph;
|
2018-04-23 13:12:00 -04:00
|
|
|
use traits::Clauses;
|
|
|
|
use ty::{self, CrateInherentImpls, ParamEnvAnd, Ty, TyCtxt};
|
2017-04-28 06:00:48 -04:00
|
|
|
use ty::steal::Steal;
|
2017-04-18 23:38:15 +03:00
|
|
|
use ty::subst::Substs;
|
2017-11-03 09:27:20 +01:00
|
|
|
use util::nodemap::{DefIdSet, DefIdMap, ItemLocalSet};
|
2018-04-19 02:33:24 +02:00
|
|
|
use util::common::{ErrorReported};
|
2016-10-28 13:55:49 +03:00
|
|
|
|
2017-09-01 22:04:09 +03:00
|
|
|
use rustc_data_structures::indexed_set::IdxSetBuf;
|
2017-12-08 21:18:21 +02:00
|
|
|
use rustc_target::spec::PanicStrategy;
|
2016-09-29 02:30:53 +03:00
|
|
|
use rustc_data_structures::indexed_vec::IndexVec;
|
2017-09-08 13:51:57 -07:00
|
|
|
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
2017-09-14 17:40:37 +02:00
|
|
|
use rustc_data_structures::stable_hasher::StableVec;
|
2017-09-07 16:11:58 +02:00
|
|
|
|
2017-04-24 18:06:39 +03:00
|
|
|
use std::ops::Deref;
|
2018-02-27 17:11:14 +01:00
|
|
|
use rustc_data_structures::sync::Lrc;
|
2017-09-12 09:32:37 -07:00
|
|
|
use std::sync::Arc;
|
2017-02-14 11:32:00 +02:00
|
|
|
use syntax_pos::{Span, DUMMY_SP};
|
2017-09-13 20:26:39 -07:00
|
|
|
use syntax_pos::symbol::InternedString;
|
2017-05-02 06:53:34 -05:00
|
|
|
use syntax::attr;
|
2017-05-03 08:40:32 -05:00
|
|
|
use syntax::ast;
|
2018-02-14 16:11:02 +01:00
|
|
|
use syntax::feature_gate;
|
2017-04-24 19:35:47 +03:00
|
|
|
use syntax::symbol::Symbol;
|
2015-12-22 16:39:33 -05:00
|
|
|
|
2017-09-18 05:40:13 -04:00
|
|
|
#[macro_use]
|
|
|
|
mod plumbing;
|
|
|
|
use self::plumbing::*;
|
2018-04-06 12:56:59 +02:00
|
|
|
pub use self::plumbing::{force_from_dep_node, CycleError};
|
2017-09-12 11:04:46 -07:00
|
|
|
|
2018-03-15 10:03:36 +01:00
|
|
|
mod job;
|
2018-03-24 06:19:20 +01:00
|
|
|
pub use self::job::{QueryJob, QueryInfo};
|
2018-04-06 12:56:59 +02:00
|
|
|
#[cfg(parallel_queries)]
|
|
|
|
pub use self::job::handle_deadlock;
|
2018-03-15 10:03:36 +01:00
|
|
|
|
2017-09-18 05:40:13 -04:00
|
|
|
mod keys;
|
|
|
|
pub use self::keys::Key;
|
2017-09-13 20:26:39 -07:00
|
|
|
|
2017-09-18 05:40:13 -04:00
|
|
|
mod values;
|
|
|
|
use self::values::Value;
|
2017-09-13 20:26:39 -07:00
|
|
|
|
2017-09-18 05:40:13 -04:00
|
|
|
mod config;
|
|
|
|
pub use self::config::QueryConfig;
|
|
|
|
use self::config::QueryDescription;
|
2017-04-28 09:40:48 -04:00
|
|
|
|
2017-10-19 14:32:39 +02:00
|
|
|
mod on_disk_cache;
|
|
|
|
pub use self::on_disk_cache::OnDiskCache;
|
|
|
|
|
2016-09-29 02:30:53 +03:00
|
|
|
// Each of these maps also corresponds to a method on a
|
|
|
|
// `Provider` trait for requesting a value of that type,
|
|
|
|
// and a method on `Maps` itself for doing that in a
|
|
|
|
// a way that memoizes and does dep-graph tracking,
|
|
|
|
// wrapping around the actual chain of providers that
|
|
|
|
// the driver creates (using several `rustc_*` crates).
|
2018-01-31 16:08:14 +01:00
|
|
|
//
|
|
|
|
// The result of query must implement Clone. They must also implement ty::maps::values::Value
|
2018-03-09 07:09:24 +01:00
|
|
|
// which produces an appropriate error value if the query resulted in a query cycle.
|
2018-01-31 16:08:14 +01:00
|
|
|
// Queries marked with `fatal_cycle` do not need that implementation
|
|
|
|
// as they will raise an fatal error on query cycles instead.
|
2016-09-29 02:30:53 +03:00
|
|
|
define_maps! { <'tcx>
|
2017-02-07 11:47:35 +02:00
|
|
|
/// Records the type of every item.
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn type_of: TypeOfItem(DefId) -> Ty<'tcx>,
|
2017-02-07 11:47:35 +02:00
|
|
|
|
|
|
|
/// Maps from the def-id of an item (trait/struct/enum/fn) to its
|
|
|
|
/// associated generics and predicates.
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn generics_of: GenericsOfItem(DefId) -> &'tcx ty::Generics,
|
|
|
|
[] fn predicates_of: PredicatesOfItem(DefId) -> ty::GenericPredicates<'tcx>,
|
2018-06-10 02:04:33 -04:00
|
|
|
[] fn explicit_predicates_of: ExplicitPredicatesOfItem(DefId) -> ty::GenericPredicates<'tcx>,
|
2017-02-07 11:47:35 +02:00
|
|
|
|
|
|
|
/// Maps from the def-id of a trait to the list of
|
|
|
|
/// super-predicates. This is a subset of the full list of
|
|
|
|
/// predicates. We store these in a separate map because we must
|
|
|
|
/// evaluate them even during type conversion, often before the
|
|
|
|
/// full predicates are available (note that supertraits have
|
|
|
|
/// additional acyclicity requirements).
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn super_predicates_of: SuperPredicatesOfItem(DefId) -> ty::GenericPredicates<'tcx>,
|
2017-02-07 11:47:35 +02:00
|
|
|
|
2016-10-04 02:19:40 +03:00
|
|
|
/// To avoid cycles within the predicates of a single item we compute
|
|
|
|
/// per-type-parameter predicates for resolving `T::AssocTy`.
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn type_param_predicates: type_param_predicates((DefId, DefId))
|
2016-10-04 02:19:40 +03:00
|
|
|
-> ty::GenericPredicates<'tcx>,
|
|
|
|
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn trait_def: TraitDefOfItem(DefId) -> &'tcx ty::TraitDef,
|
|
|
|
[] fn adt_def: AdtDefOfItem(DefId) -> &'tcx ty::AdtDef,
|
|
|
|
[] fn adt_destructor: AdtDestructor(DefId) -> Option<ty::Destructor>,
|
|
|
|
[] fn adt_sized_constraint: SizedConstraint(DefId) -> &'tcx [Ty<'tcx>],
|
2018-02-21 10:55:16 -05:00
|
|
|
[] fn adt_dtorck_constraint: DtorckConstraint(
|
|
|
|
DefId
|
|
|
|
) -> Result<DtorckConstraint<'tcx>, NoSolution>,
|
2017-02-07 11:47:35 +02:00
|
|
|
|
2017-06-11 21:16:26 -07:00
|
|
|
/// True if this is a const fn
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn is_const_fn: IsConstFn(DefId) -> bool,
|
2017-06-11 21:16:26 -07:00
|
|
|
|
2017-04-14 10:51:22 -04:00
|
|
|
/// True if this is a foreign item (i.e., linked via `extern { ... }`).
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn is_foreign_item: IsForeignItem(DefId) -> bool,
|
2017-04-14 10:51:22 -04:00
|
|
|
|
2017-04-24 11:15:12 -04:00
|
|
|
/// Get a map with the variance of every item; use `item_variance`
|
|
|
|
/// instead.
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn crate_variances: crate_variances(CrateNum) -> Lrc<ty::CrateVariancesMap>,
|
2017-04-24 11:15:12 -04:00
|
|
|
|
2017-02-07 11:47:35 +02:00
|
|
|
/// Maps from def-id of a type or region parameter to its
|
|
|
|
/// (inferred) variance.
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn variances_of: ItemVariances(DefId) -> Lrc<Vec<ty::Variance>>,
|
2017-02-07 11:47:35 +02:00
|
|
|
|
2017-09-26 00:48:32 -04:00
|
|
|
/// Maps from def-id of a type to its (inferred) outlives.
|
2017-10-15 01:13:56 -04:00
|
|
|
[] fn inferred_outlives_of: InferredOutlivesOf(DefId) -> Lrc<Vec<ty::Predicate<'tcx>>>,
|
|
|
|
|
|
|
|
/// Maps from def-id of a type to its (inferred) outlives.
|
|
|
|
[] fn inferred_outlives_crate: InferredOutlivesCrate(CrateNum)
|
|
|
|
-> Lrc<ty::CratePredicatesMap<'tcx>>,
|
2017-09-26 00:48:32 -04:00
|
|
|
|
2016-09-29 02:30:53 +03:00
|
|
|
/// Maps from an impl/trait def-id to a list of the def-ids of its items
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn associated_item_def_ids: AssociatedItemDefIds(DefId) -> Lrc<Vec<DefId>>,
|
2016-09-29 02:30:53 +03:00
|
|
|
|
|
|
|
/// Maps from a trait item to the trait item "descriptor"
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn associated_item: AssociatedItems(DefId) -> ty::AssociatedItem,
|
2016-09-29 02:30:53 +03:00
|
|
|
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn impl_trait_ref: ImplTraitRef(DefId) -> Option<ty::TraitRef<'tcx>>,
|
|
|
|
[] fn impl_polarity: ImplPolarity(DefId) -> hir::ImplPolarity,
|
2016-09-29 02:30:53 +03:00
|
|
|
|
2017-02-07 11:47:35 +02:00
|
|
|
/// Maps a DefId of a type to a list of its inherent impls.
|
|
|
|
/// Contains implementations of methods that are inherent to a type.
|
|
|
|
/// Methods in these implementations don't need to be exported.
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn inherent_impls: InherentImpls(DefId) -> Lrc<Vec<DefId>>,
|
2017-02-07 11:47:35 +02:00
|
|
|
|
2017-04-25 15:56:02 -04:00
|
|
|
/// Set of all the def-ids in this crate that have MIR associated with
|
|
|
|
/// them. This includes all the body owners, but also things like struct
|
|
|
|
/// constructors.
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn mir_keys: mir_keys(CrateNum) -> Lrc<DefIdSet>,
|
2017-04-25 15:56:02 -04:00
|
|
|
|
2017-02-20 03:55:28 +02:00
|
|
|
/// Maps DefId's that have an associated Mir to the result
|
|
|
|
/// of the MIR qualify_consts pass. The actual meaning of
|
|
|
|
/// the value isn't known except to the pass itself.
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn mir_const_qualif: MirConstQualif(DefId) -> (u8, Lrc<IdxSetBuf<mir::Local>>),
|
2017-02-20 03:55:28 +02:00
|
|
|
|
2017-11-05 18:09:39 +02:00
|
|
|
/// Fetch the MIR for a given def-id right after it's built - this includes
|
|
|
|
/// unreachable code.
|
|
|
|
[] fn mir_built: MirBuilt(DefId) -> &'tcx Steal<mir::Mir<'tcx>>,
|
|
|
|
|
2017-05-01 14:39:48 -04:00
|
|
|
/// Fetch the MIR for a given def-id up till the point where it is
|
|
|
|
/// ready for const evaluation.
|
2017-04-29 05:28:35 -04:00
|
|
|
///
|
|
|
|
/// See the README for the `mir` module for details.
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn mir_const: MirConst(DefId) -> &'tcx Steal<mir::Mir<'tcx>>,
|
2017-04-27 16:48:48 -04:00
|
|
|
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn mir_validated: MirValidated(DefId) -> &'tcx Steal<mir::Mir<'tcx>>,
|
2017-04-27 16:48:48 -04:00
|
|
|
|
|
|
|
/// MIR after our optimization passes have run. This is MIR that is ready
|
2018-05-08 16:10:16 +03:00
|
|
|
/// for codegen. This is also the only query that can fetch non-local MIR, at present.
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn optimized_mir: MirOptimized(DefId) -> &'tcx mir::Mir<'tcx>,
|
2017-04-27 16:48:48 -04:00
|
|
|
|
2017-11-05 20:04:18 +02:00
|
|
|
/// The result of unsafety-checking this def-id.
|
|
|
|
[] fn unsafety_check_result: UnsafetyCheckResult(DefId) -> mir::UnsafetyCheckResult,
|
2017-09-19 16:20:02 +03:00
|
|
|
|
2017-11-26 19:01:19 +02:00
|
|
|
/// HACK: when evaluated, this reports a "unsafe derive on repr(packed)" error
|
|
|
|
[] fn unsafe_derive_on_repr_packed: UnsafeDeriveOnReprPacked(DefId) -> (),
|
|
|
|
|
2017-05-13 13:12:29 +03:00
|
|
|
/// The signature of functions and closures.
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn fn_sig: FnSignature(DefId) -> ty::PolyFnSig<'tcx>,
|
2017-02-07 11:47:35 +02:00
|
|
|
|
|
|
|
/// Caches CoerceUnsized kinds for impls on custom types.
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn coerce_unsized_info: CoerceUnsizedInfo(DefId)
|
2017-03-17 16:17:45 -04:00
|
|
|
-> ty::adjustment::CoerceUnsizedInfo,
|
2017-02-07 11:47:35 +02:00
|
|
|
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn typeck_item_bodies: typeck_item_bodies_dep_node(CrateNum) -> CompileResult,
|
2017-03-14 22:46:36 -07:00
|
|
|
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn typeck_tables_of: TypeckTables(DefId) -> &'tcx ty::TypeckTables<'tcx>,
|
2017-03-14 22:46:36 -07:00
|
|
|
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn used_trait_imports: UsedTraitImports(DefId) -> Lrc<DefIdSet>,
|
2017-10-16 23:41:51 -07:00
|
|
|
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn has_typeck_tables: HasTypeckTables(DefId) -> bool,
|
2017-02-07 11:47:35 +02:00
|
|
|
|
2017-12-20 16:45:23 +01:00
|
|
|
[] fn coherent_trait: CoherenceCheckTrait(DefId) -> (),
|
2017-02-19 14:46:29 +02:00
|
|
|
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn borrowck: BorrowCheck(DefId) -> Lrc<BorrowCheckResult>,
|
2017-11-22 17:38:51 -05:00
|
|
|
|
|
|
|
/// Borrow checks the function body. If this is a closure, returns
|
|
|
|
/// additional requirements that the closure's creator must verify.
|
2018-03-02 20:42:37 -08:00
|
|
|
[] fn mir_borrowck: MirBorrowCheck(DefId) -> mir::BorrowCheckResult<'tcx>,
|
2017-04-04 12:06:35 -04:00
|
|
|
|
2017-03-20 18:35:16 -04:00
|
|
|
/// Gets a complete map from all types to their inherent impls.
|
|
|
|
/// Not meant to be used directly outside of coherence.
|
|
|
|
/// (Defined only for LOCAL_CRATE)
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn crate_inherent_impls: crate_inherent_impls_dep_node(CrateNum) -> CrateInherentImpls,
|
2017-03-20 18:35:16 -04:00
|
|
|
|
|
|
|
/// Checks all types in the krate for overlap in their inherent impls. Reports errors.
|
|
|
|
/// Not meant to be used directly outside of coherence.
|
|
|
|
/// (Defined only for LOCAL_CRATE)
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn crate_inherent_impls_overlap_check: inherent_impls_overlap_check_dep_node(CrateNum) -> (),
|
2017-02-19 14:46:29 +02:00
|
|
|
|
2017-04-18 23:38:15 +03:00
|
|
|
/// Results of evaluating const items or constants embedded in
|
|
|
|
/// other items (such as enum variant explicit discriminants).
|
2018-01-02 23:22:09 +00:00
|
|
|
[] fn const_eval: const_eval_dep_node(ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>)
|
2018-01-16 09:31:48 +01:00
|
|
|
-> EvalResult<'tcx>,
|
2017-02-08 18:31:03 +01:00
|
|
|
|
2018-05-03 18:29:14 +02:00
|
|
|
/// Converts a constant value to an constant allocation
|
|
|
|
[] fn const_value_to_allocation: const_value_to_allocation(
|
|
|
|
(ConstValue<'tcx>, Ty<'tcx>)
|
|
|
|
) -> &'tcx Allocation,
|
|
|
|
|
2017-11-19 00:20:41 +09:00
|
|
|
[] fn check_match: CheckMatch(DefId)
|
|
|
|
-> Result<(), ErrorReported>,
|
|
|
|
|
2017-03-23 15:13:29 -04:00
|
|
|
/// Performs the privacy check and computes "access levels".
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn privacy_access_levels: PrivacyAccessLevels(CrateNum) -> Lrc<AccessLevels>,
|
2017-03-23 15:13:29 -04:00
|
|
|
|
2017-08-14 18:19:42 +02:00
|
|
|
[] fn reachable_set: reachability_dep_node(CrateNum) -> ReachableSet,
|
2017-03-27 15:55:56 -07:00
|
|
|
|
2017-08-31 21:37:38 +03:00
|
|
|
/// Per-body `region::ScopeTree`. The `DefId` should be the owner-def-id for the body;
|
|
|
|
/// in the case of closures, this will be redirected to the enclosing function.
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn region_scope_tree: RegionScopeTree(DefId) -> Lrc<region::ScopeTree>,
|
2017-08-30 22:25:02 -04:00
|
|
|
|
|
|
|
[] fn mir_shims: mir_shim_dep_node(ty::InstanceDef<'tcx>) -> &'tcx mir::Mir<'tcx>,
|
|
|
|
|
|
|
|
[] fn def_symbol_name: SymbolName(DefId) -> ty::SymbolName,
|
|
|
|
[] fn symbol_name: symbol_name_dep_node(ty::Instance<'tcx>) -> ty::SymbolName,
|
|
|
|
|
|
|
|
[] fn describe_def: DescribeDef(DefId) -> Option<Def>,
|
|
|
|
[] fn def_span: DefSpan(DefId) -> Span,
|
2017-08-31 15:08:34 -07:00
|
|
|
[] fn lookup_stability: LookupStability(DefId) -> Option<&'tcx attr::Stability>,
|
|
|
|
[] fn lookup_deprecation_entry: LookupDeprecationEntry(DefId) -> Option<DeprecationEntry>,
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn item_attrs: ItemAttrs(DefId) -> Lrc<[ast::Attribute]>,
|
2018-05-08 16:10:16 +03:00
|
|
|
[] fn codegen_fn_attrs: codegen_fn_attrs(DefId) -> CodegenFnAttrs,
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn fn_arg_names: FnArgNames(DefId) -> Vec<ast::Name>,
|
2018-04-15 19:41:33 -04:00
|
|
|
/// Gets the rendered value of the specified constant or associated constant.
|
|
|
|
/// Used by rustdoc.
|
|
|
|
[] fn rendered_const: RenderedConst(DefId) -> String,
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn impl_parent: ImplParent(DefId) -> Option<DefId>,
|
|
|
|
[] fn trait_of_item: TraitOfItem(DefId) -> Option<DefId>,
|
|
|
|
[] fn const_is_rvalue_promotable_to_static: ConstIsRvaluePromotableToStatic(DefId) -> bool,
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn rvalue_promotable_map: RvaluePromotableMap(DefId) -> Lrc<ItemLocalSet>,
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn is_mir_available: IsMirAvailable(DefId) -> bool,
|
2017-10-07 16:55:09 -05:00
|
|
|
[] fn vtable_methods: vtable_methods_node(ty::PolyTraitRef<'tcx>)
|
2018-02-27 17:11:14 +01:00
|
|
|
-> Lrc<Vec<Option<(DefId, &'tcx Substs<'tcx>)>>>,
|
2017-08-30 22:25:02 -04:00
|
|
|
|
2018-05-08 16:10:16 +03:00
|
|
|
[] fn codegen_fulfill_obligation: fulfill_obligation_dep_node(
|
2017-09-28 23:13:43 -04:00
|
|
|
(ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>)) -> Vtable<'tcx, ()>,
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn trait_impls_of: TraitImpls(DefId) -> Lrc<ty::trait_def::TraitImpls>,
|
|
|
|
[] fn specialization_graph_of: SpecializationGraph(DefId) -> Lrc<specialization_graph::Graph>,
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn is_object_safe: ObjectSafety(DefId) -> bool,
|
2017-05-10 10:28:06 -04:00
|
|
|
|
2017-05-17 08:01:04 -04:00
|
|
|
// Get the ParameterEnvironment for a given item; this environment
|
|
|
|
// will be in "user-facing" mode, meaning that it is suitabe for
|
|
|
|
// type-checking etc, and it does not normalize specializable
|
|
|
|
// associated types. This is almost always what you want,
|
|
|
|
// unless you are doing MIR optimizations, in which case you
|
|
|
|
// might want to use `reveal_all()` method to change modes.
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn param_env: ParamEnv(DefId) -> ty::ParamEnv<'tcx>,
|
2017-05-11 17:40:03 -04:00
|
|
|
|
2017-05-10 10:28:06 -04:00
|
|
|
// Trait selection queries. These are best used by invoking `ty.moves_by_default()`,
|
|
|
|
// `ty.is_copy()`, etc, since that will prune the environment where possible.
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn is_copy_raw: is_copy_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool,
|
|
|
|
[] fn is_sized_raw: is_sized_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool,
|
|
|
|
[] fn is_freeze_raw: is_freeze_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool,
|
|
|
|
[] fn needs_drop_raw: needs_drop_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool,
|
|
|
|
[] fn layout_raw: layout_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>)
|
2017-10-28 16:52:41 +03:00
|
|
|
-> Result<&'tcx ty::layout::LayoutDetails,
|
2017-09-13 14:35:04 +03:00
|
|
|
ty::layout::LayoutError<'tcx>>,
|
2017-06-11 22:40:14 -07:00
|
|
|
|
2017-08-28 15:55:32 -07:00
|
|
|
[] fn dylib_dependency_formats: DylibDepFormats(CrateNum)
|
2018-02-27 17:11:14 +01:00
|
|
|
-> Lrc<Vec<(CrateNum, LinkagePreference)>>,
|
2017-06-12 00:11:24 -07:00
|
|
|
|
2018-01-31 16:08:14 +01:00
|
|
|
[fatal_cycle] fn is_panic_runtime: IsPanicRuntime(CrateNum) -> bool,
|
|
|
|
[fatal_cycle] fn is_compiler_builtins: IsCompilerBuiltins(CrateNum) -> bool,
|
|
|
|
[fatal_cycle] fn has_global_allocator: HasGlobalAllocator(CrateNum) -> bool,
|
|
|
|
[fatal_cycle] fn is_sanitizer_runtime: IsSanitizerRuntime(CrateNum) -> bool,
|
|
|
|
[fatal_cycle] fn is_profiler_runtime: IsProfilerRuntime(CrateNum) -> bool,
|
|
|
|
[fatal_cycle] fn panic_strategy: GetPanicStrategy(CrateNum) -> PanicStrategy,
|
|
|
|
[fatal_cycle] fn is_no_builtins: IsNoBuiltins(CrateNum) -> bool,
|
2017-06-12 00:59:22 -07:00
|
|
|
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn extern_crate: ExternCrate(DefId) -> Lrc<Option<ExternCrate>>,
|
2017-07-26 21:51:09 -07:00
|
|
|
|
2017-08-30 22:25:02 -04:00
|
|
|
[] fn specializes: specializes_node((DefId, DefId)) -> bool,
|
2017-09-08 13:51:57 -07:00
|
|
|
[] fn in_scope_traits_map: InScopeTraits(DefIndex)
|
2018-02-27 17:11:14 +01:00
|
|
|
-> Option<Lrc<FxHashMap<ItemLocalId, Lrc<StableVec<TraitCandidate>>>>>,
|
|
|
|
[] fn module_exports: ModuleExports(DefId) -> Option<Lrc<Vec<Export>>>,
|
|
|
|
[] fn lint_levels: lint_levels_node(CrateNum) -> Lrc<lint::LintLevelMap>,
|
2017-08-28 16:50:25 -07:00
|
|
|
|
|
|
|
[] fn impl_defaultness: ImplDefaultness(DefId) -> hir::Defaultness,
|
2018-02-22 12:18:16 +01:00
|
|
|
|
2018-03-09 22:35:15 -05:00
|
|
|
[] fn check_item_well_formed: CheckItemWellFormed(DefId) -> (),
|
2018-03-10 11:25:03 -05:00
|
|
|
[] fn check_trait_item_well_formed: CheckTraitItemWellFormed(DefId) -> (),
|
2018-03-10 17:17:30 -05:00
|
|
|
[] fn check_impl_item_well_formed: CheckImplItemWellFormed(DefId) -> (),
|
2018-03-09 22:35:15 -05:00
|
|
|
|
2018-02-22 12:18:16 +01:00
|
|
|
// The DefIds of all non-generic functions and statics in the given crate
|
|
|
|
// that can be reached from outside the crate.
|
|
|
|
//
|
|
|
|
// We expect this items to be available for being linked to.
|
|
|
|
//
|
|
|
|
// This query can also be called for LOCAL_CRATE. In this case it will
|
|
|
|
// compute which items will be reachable to other crates, taking into account
|
|
|
|
// the kind of crate that is currently compiled. Crates with only a
|
|
|
|
// C interface have fewer reachable things.
|
|
|
|
//
|
|
|
|
// Does not include external symbols that don't have a corresponding DefId,
|
|
|
|
// like the compiler-generated `main` function and so on.
|
2018-03-06 10:33:42 +01:00
|
|
|
[] fn reachable_non_generics: ReachableNonGenerics(CrateNum)
|
|
|
|
-> Lrc<DefIdMap<SymbolExportLevel>>,
|
2018-02-22 12:18:16 +01:00
|
|
|
[] fn is_reachable_non_generic: IsReachableNonGeneric(DefId) -> bool,
|
2018-03-06 14:44:14 +01:00
|
|
|
[] fn is_unreachable_local_definition: IsUnreachableLocalDefinition(DefId) -> bool,
|
2018-02-22 12:18:16 +01:00
|
|
|
|
2018-03-06 10:33:42 +01:00
|
|
|
[] fn upstream_monomorphizations: UpstreamMonomorphizations(CrateNum)
|
|
|
|
-> Lrc<DefIdMap<Lrc<FxHashMap<&'tcx Substs<'tcx>, CrateNum>>>>,
|
|
|
|
[] fn upstream_monomorphizations_for: UpstreamMonomorphizationsFor(DefId)
|
|
|
|
-> Option<Lrc<FxHashMap<&'tcx Substs<'tcx>, CrateNum>>>,
|
2018-02-22 12:18:16 +01:00
|
|
|
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn native_libraries: NativeLibraries(CrateNum) -> Lrc<Vec<NativeLibrary>>,
|
2018-02-10 14:28:17 -08:00
|
|
|
|
|
|
|
[] fn foreign_modules: ForeignModules(CrateNum) -> Lrc<Vec<ForeignModule>>,
|
|
|
|
|
2017-08-28 17:30:27 -07:00
|
|
|
[] fn plugin_registrar_fn: PluginRegistrarFn(CrateNum) -> Option<DefId>,
|
|
|
|
[] fn derive_registrar_fn: DeriveRegistrarFn(CrateNum) -> Option<DefId>,
|
2017-10-24 17:49:58 +02:00
|
|
|
[] fn crate_disambiguator: CrateDisambiguator(CrateNum) -> CrateDisambiguator,
|
2017-08-28 17:30:27 -07:00
|
|
|
[] fn crate_hash: CrateHash(CrateNum) -> Svh,
|
2017-08-28 17:30:27 -07:00
|
|
|
[] fn original_crate_name: OriginalCrateName(CrateNum) -> Symbol,
|
2018-03-13 11:58:53 -07:00
|
|
|
[] fn extra_filename: ExtraFileName(CrateNum) -> String,
|
2017-08-30 11:40:02 -07:00
|
|
|
|
|
|
|
[] fn implementations_of_trait: implementations_of_trait_node((CrateNum, DefId))
|
2018-02-27 17:11:14 +01:00
|
|
|
-> Lrc<Vec<DefId>>,
|
2017-08-30 11:40:02 -07:00
|
|
|
[] fn all_trait_implementations: AllTraitImplementations(CrateNum)
|
2018-02-27 17:11:14 +01:00
|
|
|
-> Lrc<Vec<DefId>>,
|
2017-08-30 14:48:57 -07:00
|
|
|
|
2018-02-10 14:28:17 -08:00
|
|
|
[] fn dllimport_foreign_items: DllimportForeignItems(CrateNum)
|
|
|
|
-> Lrc<FxHashSet<DefId>>,
|
2017-08-31 15:08:34 -07:00
|
|
|
[] fn is_dllimport_foreign_item: IsDllimportForeignItem(DefId) -> bool,
|
|
|
|
[] fn is_statically_included_foreign_item: IsStaticallyIncludedForeignItem(DefId) -> bool,
|
|
|
|
[] fn native_library_kind: NativeLibraryKind(DefId)
|
2017-08-30 14:48:57 -07:00
|
|
|
-> Option<NativeLibraryKind>,
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn link_args: link_args_node(CrateNum) -> Lrc<Vec<String>>,
|
2017-08-30 09:31:14 -07:00
|
|
|
|
2017-11-23 08:05:58 -05:00
|
|
|
// Lifetime resolution. See `middle::resolve_lifetimes`.
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn resolve_lifetimes: ResolveLifetimes(CrateNum) -> Lrc<ResolveLifetimes>,
|
2017-09-08 13:51:57 -07:00
|
|
|
[] fn named_region_map: NamedRegion(DefIndex) ->
|
2018-02-27 17:11:14 +01:00
|
|
|
Option<Lrc<FxHashMap<ItemLocalId, Region>>>,
|
2017-09-08 13:51:57 -07:00
|
|
|
[] fn is_late_bound_map: IsLateBound(DefIndex) ->
|
2018-02-27 17:11:14 +01:00
|
|
|
Option<Lrc<FxHashSet<ItemLocalId>>>,
|
2017-09-08 13:51:57 -07:00
|
|
|
[] fn object_lifetime_defaults_map: ObjectLifetimeDefaults(DefIndex)
|
2018-02-27 17:11:14 +01:00
|
|
|
-> Option<Lrc<FxHashMap<ItemLocalId, Lrc<Vec<ObjectLifetimeDefault>>>>>,
|
2017-08-31 08:07:39 -07:00
|
|
|
|
2017-08-31 15:08:34 -07:00
|
|
|
[] fn visibility: Visibility(DefId) -> ty::Visibility,
|
|
|
|
[] fn dep_kind: DepKind(CrateNum) -> DepKind,
|
|
|
|
[] fn crate_name: CrateName(CrateNum) -> Symbol,
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn item_children: ItemChildren(DefId) -> Lrc<Vec<Export>>,
|
2017-09-08 13:51:57 -07:00
|
|
|
[] fn extern_mod_stmt_cnum: ExternModStmtCnum(DefId) -> Option<CrateNum>,
|
2017-08-31 15:08:34 -07:00
|
|
|
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn get_lang_items: get_lang_items_node(CrateNum) -> Lrc<LanguageItems>,
|
|
|
|
[] fn defined_lang_items: DefinedLangItems(CrateNum) -> Lrc<Vec<(DefId, usize)>>,
|
|
|
|
[] fn missing_lang_items: MissingLangItems(CrateNum) -> Lrc<Vec<LangItem>>,
|
2017-08-31 15:08:34 -07:00
|
|
|
[] fn visible_parent_map: visible_parent_map_node(CrateNum)
|
2018-02-27 17:11:14 +01:00
|
|
|
-> Lrc<DefIdMap<DefId>>,
|
2017-08-31 15:08:34 -07:00
|
|
|
[] fn missing_extern_crate_item: MissingExternCrateItem(CrateNum) -> bool,
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn used_crate_source: UsedCrateSource(CrateNum) -> Lrc<CrateSource>,
|
|
|
|
[] fn postorder_cnums: postorder_cnums_node(CrateNum) -> Lrc<Vec<CrateNum>>,
|
2017-08-31 12:30:25 -07:00
|
|
|
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn freevars: Freevars(DefId) -> Option<Lrc<Vec<hir::Freevar>>>,
|
2017-09-08 13:51:57 -07:00
|
|
|
[] fn maybe_unused_trait_import: MaybeUnusedTraitImport(DefId) -> bool,
|
2017-08-31 15:08:34 -07:00
|
|
|
[] fn maybe_unused_extern_crates: maybe_unused_extern_crates_node(CrateNum)
|
2018-02-27 17:11:14 +01:00
|
|
|
-> Lrc<Vec<(DefId, Span)>>,
|
2017-08-31 15:08:34 -07:00
|
|
|
|
2018-02-27 17:11:14 +01:00
|
|
|
[] fn stability_index: stability_index_node(CrateNum) -> Lrc<stability::Index<'tcx>>,
|
|
|
|
[] fn all_crate_nums: all_crate_nums_node(CrateNum) -> Lrc<Vec<CrateNum>>,
|
2017-09-12 09:32:37 -07:00
|
|
|
|
2018-04-01 08:15:25 +02:00
|
|
|
/// A vector of every trait accessible in the whole crate
|
|
|
|
/// (i.e. including those from subcrates). This is used only for
|
|
|
|
/// error reporting.
|
|
|
|
[] fn all_traits: all_traits_node(CrateNum) -> Lrc<Vec<DefId>>,
|
|
|
|
|
2017-09-13 13:22:20 -07:00
|
|
|
[] fn exported_symbols: ExportedSymbols(CrateNum)
|
2018-03-01 16:50:08 +01:00
|
|
|
-> Arc<Vec<(ExportedSymbol<'tcx>, SymbolExportLevel)>>,
|
2018-05-08 16:10:16 +03:00
|
|
|
[] fn collect_and_partition_mono_items:
|
|
|
|
collect_and_partition_mono_items_node(CrateNum)
|
2017-09-13 15:24:13 -07:00
|
|
|
-> (Arc<DefIdSet>, Arc<Vec<Arc<CodegenUnit<'tcx>>>>),
|
2018-05-08 16:10:16 +03:00
|
|
|
[] fn is_codegened_item: IsCodegenedItem(DefId) -> bool,
|
2017-09-13 20:26:39 -07:00
|
|
|
[] fn codegen_unit: CodegenUnit(InternedString) -> Arc<CodegenUnit<'tcx>>,
|
|
|
|
[] fn compile_codegen_unit: CompileCodegenUnit(InternedString) -> Stats,
|
|
|
|
[] fn output_filenames: output_filenames_node(CrateNum)
|
|
|
|
-> Arc<OutputFilenames>,
|
2017-09-20 20:42:49 +02:00
|
|
|
|
2017-10-17 11:24:46 -04:00
|
|
|
// Erases regions from `ty` to yield a new type.
|
|
|
|
// Normally you would just use `tcx.erase_regions(&value)`,
|
|
|
|
// however, which uses this query as a kind of cache.
|
|
|
|
[] fn erase_regions_ty: erase_regions_ty(Ty<'tcx>) -> Ty<'tcx>,
|
2017-12-27 12:32:44 -05:00
|
|
|
|
2018-02-25 10:58:54 -05:00
|
|
|
/// Do not call this query directly: invoke `normalize` instead.
|
|
|
|
[] fn normalize_projection_ty: NormalizeProjectionTy(
|
|
|
|
CanonicalProjectionGoal<'tcx>
|
|
|
|
) -> Result<
|
2018-03-15 10:03:36 +01:00
|
|
|
Lrc<Canonical<'tcx, canonical::QueryResult<'tcx, NormalizationResult<'tcx>>>>,
|
2018-02-25 10:58:54 -05:00
|
|
|
NoSolution,
|
|
|
|
>,
|
|
|
|
|
2018-02-21 11:24:13 -05:00
|
|
|
/// Do not call this query directly: invoke `normalize_erasing_regions` instead.
|
|
|
|
[] fn normalize_ty_after_erasing_regions: NormalizeTyAfterErasingRegions(
|
|
|
|
ParamEnvAnd<'tcx, Ty<'tcx>>
|
|
|
|
) -> Ty<'tcx>,
|
|
|
|
|
2018-02-21 10:55:16 -05:00
|
|
|
/// Do not call this query directly: invoke `infcx.at().dropck_outlives()` instead.
|
|
|
|
[] fn dropck_outlives: DropckOutlives(
|
|
|
|
CanonicalTyGoal<'tcx>
|
|
|
|
) -> Result<
|
2018-03-15 10:03:36 +01:00
|
|
|
Lrc<Canonical<'tcx, canonical::QueryResult<'tcx, DropckOutlivesResult<'tcx>>>>,
|
2018-02-21 10:55:16 -05:00
|
|
|
NoSolution,
|
|
|
|
>,
|
|
|
|
|
2018-03-08 18:30:37 -06:00
|
|
|
/// Do not call this query directly: invoke `infcx.predicate_may_hold()` or
|
|
|
|
/// `infcx.predicate_must_hold()` instead.
|
2018-04-19 03:15:36 -05:00
|
|
|
[] fn evaluate_obligation: EvaluateObligation(
|
|
|
|
CanonicalPredicateGoal<'tcx>
|
|
|
|
) -> Result<traits::EvaluationResult, traits::OverflowError>,
|
2018-03-08 18:30:37 -06:00
|
|
|
|
2017-12-27 12:32:44 -05:00
|
|
|
[] fn substitute_normalize_and_test_predicates:
|
|
|
|
substitute_normalize_and_test_predicates_node((DefId, &'tcx Substs<'tcx>)) -> bool,
|
2018-01-05 13:26:26 -08:00
|
|
|
|
|
|
|
[] fn target_features_whitelist:
|
2018-04-05 08:02:11 -07:00
|
|
|
target_features_whitelist_node(CrateNum) -> Lrc<FxHashMap<String, Option<String>>>,
|
2018-01-05 13:26:26 -08:00
|
|
|
|
2018-01-19 00:32:58 +00:00
|
|
|
// Get an estimate of the size of an InstanceDef based on its MIR for CGU partitioning.
|
|
|
|
[] fn instance_def_size_estimate: instance_def_size_estimate_dep_node(ty::InstanceDef<'tcx>)
|
|
|
|
-> usize,
|
2018-02-14 16:11:02 +01:00
|
|
|
|
|
|
|
[] fn features_query: features_node(CrateNum) -> Lrc<feature_gate::Features>,
|
2018-03-10 12:44:33 +01:00
|
|
|
|
2018-04-23 13:12:00 -04:00
|
|
|
[] fn program_clauses_for: ProgramClausesFor(DefId) -> Clauses<'tcx>,
|
2018-03-09 09:26:15 -08:00
|
|
|
|
2018-04-10 05:55:18 -04:00
|
|
|
[] fn program_clauses_for_env: ProgramClausesForEnv(
|
|
|
|
ty::ParamEnv<'tcx>
|
2018-04-23 13:12:00 -04:00
|
|
|
) -> Clauses<'tcx>,
|
2018-04-10 05:55:18 -04:00
|
|
|
|
2018-03-09 09:26:15 -08:00
|
|
|
[] fn wasm_custom_sections: WasmCustomSections(CrateNum) -> Lrc<Vec<DefId>>,
|
2018-02-10 14:28:17 -08:00
|
|
|
[] fn wasm_import_module_map: WasmImportModuleMap(CrateNum)
|
|
|
|
-> Lrc<FxHashMap<DefId, String>>,
|
2017-02-07 11:47:35 +02:00
|
|
|
}
|
2017-02-19 14:46:29 +02:00
|
|
|
|
2017-09-18 05:40:13 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
// These functions are little shims used to find the dep-node for a
|
|
|
|
// given query when there is not a *direct* mapping:
|
|
|
|
|
2018-02-14 16:11:02 +01:00
|
|
|
|
|
|
|
fn features_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::Features
|
|
|
|
}
|
|
|
|
|
2018-05-08 16:10:16 +03:00
|
|
|
fn codegen_fn_attrs<'tcx>(id: DefId) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::CodegenFnAttrs { 0: id }
|
2018-01-15 20:08:09 -05:00
|
|
|
}
|
|
|
|
|
2017-10-17 11:24:46 -04:00
|
|
|
fn erase_regions_ty<'tcx>(ty: Ty<'tcx>) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::EraseRegionsTy { ty }
|
|
|
|
}
|
|
|
|
|
2018-05-03 18:29:14 +02:00
|
|
|
fn const_value_to_allocation<'tcx>(
|
|
|
|
(val, ty): (ConstValue<'tcx>, Ty<'tcx>)
|
|
|
|
) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::ConstValueToAllocation { val, ty }
|
|
|
|
}
|
|
|
|
|
2017-06-30 14:53:35 -07:00
|
|
|
fn type_param_predicates<'tcx>((item_id, param_id): (DefId, DefId)) -> DepConstructor<'tcx> {
|
2017-06-02 17:36:30 +02:00
|
|
|
DepConstructor::TypeParamPredicates {
|
|
|
|
item_id,
|
|
|
|
param_id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-28 23:13:43 -04:00
|
|
|
fn fulfill_obligation_dep_node<'tcx>((param_env, trait_ref):
|
|
|
|
(ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>)) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::FulfillObligation {
|
|
|
|
param_env,
|
|
|
|
trait_ref
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-30 14:53:35 -07:00
|
|
|
fn crate_inherent_impls_dep_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
2017-06-02 17:36:30 +02:00
|
|
|
DepConstructor::Coherence
|
2017-02-19 14:46:29 +02:00
|
|
|
}
|
2017-02-08 18:31:03 +01:00
|
|
|
|
2017-08-01 16:34:20 +02:00
|
|
|
fn inherent_impls_overlap_check_dep_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::CoherenceInherentImplOverlapCheck
|
|
|
|
}
|
|
|
|
|
2017-06-30 14:53:35 -07:00
|
|
|
fn reachability_dep_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
2017-06-02 17:36:30 +02:00
|
|
|
DepConstructor::Reachability
|
2017-03-27 15:55:56 -07:00
|
|
|
}
|
|
|
|
|
2017-06-30 14:53:35 -07:00
|
|
|
fn mir_shim_dep_node<'tcx>(instance_def: ty::InstanceDef<'tcx>) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::MirShim {
|
|
|
|
instance_def
|
|
|
|
}
|
2017-02-08 18:31:03 +01:00
|
|
|
}
|
2017-03-14 22:46:36 -07:00
|
|
|
|
2017-06-30 14:53:35 -07:00
|
|
|
fn symbol_name_dep_node<'tcx>(instance: ty::Instance<'tcx>) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::InstanceSymbolName { instance }
|
2017-04-24 19:35:47 +03:00
|
|
|
}
|
|
|
|
|
2017-06-30 14:53:35 -07:00
|
|
|
fn typeck_item_bodies_dep_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
2017-06-02 17:36:30 +02:00
|
|
|
DepConstructor::TypeckBodiesKrate
|
2017-03-14 22:46:36 -07:00
|
|
|
}
|
2017-04-18 23:38:15 +03:00
|
|
|
|
2018-01-02 23:22:09 +00:00
|
|
|
fn const_eval_dep_node<'tcx>(param_env: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>)
|
2017-07-04 14:23:07 +02:00
|
|
|
-> DepConstructor<'tcx> {
|
2017-09-27 18:30:26 +02:00
|
|
|
DepConstructor::ConstEval { param_env }
|
2017-04-28 00:50:27 -07:00
|
|
|
}
|
2017-04-25 15:56:02 -04:00
|
|
|
|
2017-06-30 14:53:35 -07:00
|
|
|
fn mir_keys<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
2017-06-02 17:36:30 +02:00
|
|
|
DepConstructor::MirKeys
|
2017-04-25 15:56:02 -04:00
|
|
|
}
|
2017-04-24 11:15:12 -04:00
|
|
|
|
2017-06-30 14:53:35 -07:00
|
|
|
fn crate_variances<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
2017-06-02 17:36:30 +02:00
|
|
|
DepConstructor::CrateVariances
|
2017-04-24 11:15:12 -04:00
|
|
|
}
|
2017-05-11 16:01:19 +02:00
|
|
|
|
2017-09-27 18:30:26 +02:00
|
|
|
fn is_copy_dep_node<'tcx>(param_env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::IsCopy { param_env }
|
2017-05-10 10:28:06 -04:00
|
|
|
}
|
|
|
|
|
2017-09-27 18:30:26 +02:00
|
|
|
fn is_sized_dep_node<'tcx>(param_env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::IsSized { param_env }
|
2017-05-10 10:28:06 -04:00
|
|
|
}
|
|
|
|
|
2017-09-27 18:30:26 +02:00
|
|
|
fn is_freeze_dep_node<'tcx>(param_env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::IsFreeze { param_env }
|
2017-05-10 10:28:06 -04:00
|
|
|
}
|
2017-05-12 11:44:31 -04:00
|
|
|
|
2017-09-27 18:30:26 +02:00
|
|
|
fn needs_drop_dep_node<'tcx>(param_env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::NeedsDrop { param_env }
|
2017-05-12 11:44:31 -04:00
|
|
|
}
|
2017-05-19 17:27:25 -04:00
|
|
|
|
2017-09-27 18:30:26 +02:00
|
|
|
fn layout_dep_node<'tcx>(param_env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::Layout { param_env }
|
2017-05-19 17:27:25 -04:00
|
|
|
}
|
2017-07-26 21:51:09 -07:00
|
|
|
|
2017-08-28 15:55:32 -07:00
|
|
|
fn lint_levels_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
2017-07-26 21:51:09 -07:00
|
|
|
DepConstructor::LintLevels
|
|
|
|
}
|
2017-08-29 09:25:25 -07:00
|
|
|
|
|
|
|
fn specializes_node<'tcx>((a, b): (DefId, DefId)) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::Specializes { impl1: a, impl2: b }
|
|
|
|
}
|
2017-08-30 11:40:02 -07:00
|
|
|
|
|
|
|
fn implementations_of_trait_node<'tcx>((krate, trait_id): (CrateNum, DefId))
|
|
|
|
-> DepConstructor<'tcx>
|
|
|
|
{
|
|
|
|
DepConstructor::ImplementationsOfTrait { krate, trait_id }
|
|
|
|
}
|
2017-08-30 14:48:57 -07:00
|
|
|
|
|
|
|
fn link_args_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::LinkArgs
|
|
|
|
}
|
2017-08-31 08:57:41 -07:00
|
|
|
|
|
|
|
fn get_lang_items_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::GetLangItems
|
|
|
|
}
|
2017-08-31 11:30:22 -07:00
|
|
|
|
|
|
|
fn visible_parent_map_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::VisibleParentMap
|
|
|
|
}
|
2017-08-31 12:08:29 -07:00
|
|
|
|
|
|
|
fn postorder_cnums_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::PostorderCnums
|
|
|
|
}
|
2017-08-31 13:19:33 -07:00
|
|
|
|
|
|
|
fn maybe_unused_extern_crates_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::MaybeUnusedExternCrates
|
|
|
|
}
|
2017-08-31 15:08:34 -07:00
|
|
|
|
|
|
|
fn stability_index_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::StabilityIndex
|
|
|
|
}
|
2017-09-07 08:13:41 -07:00
|
|
|
|
|
|
|
fn all_crate_nums_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::AllCrateNums
|
|
|
|
}
|
2017-09-12 09:32:37 -07:00
|
|
|
|
2018-04-01 08:15:25 +02:00
|
|
|
fn all_traits_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::AllTraits
|
|
|
|
}
|
|
|
|
|
2018-05-08 16:10:16 +03:00
|
|
|
fn collect_and_partition_mono_items_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::CollectAndPartitionMonoItems
|
2017-09-12 11:04:46 -07:00
|
|
|
}
|
2017-09-13 20:26:39 -07:00
|
|
|
|
|
|
|
fn output_filenames_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::OutputFilenames
|
|
|
|
}
|
2017-10-07 16:55:09 -05:00
|
|
|
|
|
|
|
fn vtable_methods_node<'tcx>(trait_ref: ty::PolyTraitRef<'tcx>) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::VtableMethods{ trait_ref }
|
|
|
|
}
|
2018-02-25 10:58:54 -05:00
|
|
|
|
2017-12-27 12:32:44 -05:00
|
|
|
fn substitute_normalize_and_test_predicates_node<'tcx>(key: (DefId, &'tcx Substs<'tcx>))
|
|
|
|
-> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::SubstituteNormalizeAndTestPredicates { key }
|
|
|
|
}
|
2018-01-05 13:26:26 -08:00
|
|
|
|
|
|
|
fn target_features_whitelist_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::TargetFeaturesWhitelist
|
|
|
|
}
|
2018-01-19 00:32:58 +00:00
|
|
|
|
|
|
|
fn instance_def_size_estimate_dep_node<'tcx>(instance_def: ty::InstanceDef<'tcx>)
|
|
|
|
-> DepConstructor<'tcx> {
|
|
|
|
DepConstructor::InstanceDefSizeEstimate {
|
|
|
|
instance_def
|
|
|
|
}
|
|
|
|
}
|