diff options
Diffstat (limited to 'src/librustc/ty/query/mod.rs')
| -rw-r--r-- | src/librustc/ty/query/mod.rs | 37 | 
1 files changed, 32 insertions, 5 deletions
diff --git a/src/librustc/ty/query/mod.rs b/src/librustc/ty/query/mod.rs index 14e4ddfcdd6..c82a44011db 100644 --- a/src/librustc/ty/query/mod.rs +++ b/src/librustc/ty/query/mod.rs @@ -34,9 +34,12 @@ use mir::interpret::GlobalId; use session::{CompileResult, CrateDisambiguator}; use session::config::OutputFilenames; use traits::{self, Vtable}; -use traits::query::{CanonicalPredicateGoal, CanonicalProjectionGoal, - CanonicalTyGoal, CanonicalTypeOpEqGoal, CanonicalTypeOpSubtypeGoal, - CanonicalTypeOpProvePredicateGoal, CanonicalTypeOpNormalizeGoal, NoSolution}; +use traits::query::{ + CanonicalPredicateGoal, CanonicalProjectionGoal, + CanonicalTyGoal, CanonicalTypeOpAscribeUserTypeGoal, CanonicalTypeOpEqGoal, + CanonicalTypeOpSubtypeGoal, CanonicalTypeOpProvePredicateGoal, + CanonicalTypeOpNormalizeGoal, NoSolution, +}; use traits::query::dropck_outlives::{DtorckConstraint, DropckOutlivesResult}; use traits::query::normalize::NormalizationResult; use traits::query::outlives_bounds::OutlivesBound; @@ -288,7 +291,8 @@ define_queries! { <'tcx> /// 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) - [] fn crate_inherent_impls: crate_inherent_impls_dep_node(CrateNum) -> CrateInherentImpls, + [] fn crate_inherent_impls: crate_inherent_impls_dep_node(CrateNum) + -> Lrc<CrateInherentImpls>, /// Checks all types in the krate for overlap in their inherent impls. Reports errors. /// Not meant to be used directly outside of coherence. @@ -298,6 +302,14 @@ define_queries! { <'tcx> }, Other { + /// Evaluate a constant without running sanity checks + /// + /// DO NOT USE THIS outside const eval. Const eval uses this to break query cycles during + /// validation. Please add a comment to every use site explaining why using `const_eval` + /// isn't sufficient + [] fn const_eval_raw: const_eval_raw_dep_node(ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>) + -> ConstEvalResult<'tcx>, + /// Results of evaluating const items or constants embedded in /// other items (such as enum variant explicit discriminants). [] fn const_eval: const_eval_dep_node(ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>) @@ -590,6 +602,14 @@ define_queries! { <'tcx> ) -> Result<traits::EvaluationResult, traits::OverflowError>, /// Do not call this query directly: part of the `Eq` type-op + [] fn type_op_ascribe_user_type: TypeOpAscribeUserType( + CanonicalTypeOpAscribeUserTypeGoal<'tcx> + ) -> Result< + Lrc<Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>>, + NoSolution, + >, + + /// Do not call this query directly: part of the `Eq` type-op [] fn type_op_eq: TypeOpEq( CanonicalTypeOpEqGoal<'tcx> ) -> Result< @@ -664,8 +684,11 @@ define_queries! { <'tcx> [] fn program_clauses_for: ProgramClausesFor(DefId) -> Clauses<'tcx>, [] fn program_clauses_for_env: ProgramClausesForEnv( - ty::ParamEnv<'tcx> + traits::Environment<'tcx> ) -> Clauses<'tcx>, + + // Get the chalk-style environment of the given item. + [] fn environment: Environment(DefId) -> ty::Binder<traits::Environment<'tcx>>, }, Linking { @@ -762,6 +785,10 @@ fn const_eval_dep_node<'tcx>(param_env: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>) -> DepConstructor<'tcx> { DepConstructor::ConstEval { param_env } } +fn const_eval_raw_dep_node<'tcx>(param_env: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>) + -> DepConstructor<'tcx> { + DepConstructor::ConstEvalRaw { param_env } +} fn mir_keys<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { DepConstructor::MirKeys  | 
