1- use super :: { CanonicalInput , Certainty , Goal , NoSolution , QueryResult } ;
1+ use super :: { CandidateSource , CanonicalInput , Certainty , Goal , NoSolution , QueryResult } ;
22use crate :: infer:: canonical:: { Canonical , CanonicalVarValues } ;
33use crate :: ty;
44use format:: ProofTreeFormatter ;
@@ -13,27 +13,25 @@ pub struct State<'tcx, T> {
1313}
1414pub type CanonicalState < ' tcx , T > = Canonical < ' tcx , State < ' tcx , T > > ;
1515
16- #[ derive( Eq , PartialEq , Debug , Hash , HashStable ) ]
16+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
1717pub enum CacheHit {
1818 Provisional ,
1919 Global ,
2020}
2121
22- #[ derive( Debug , PartialEq , Eq , Hash , HashStable ) ]
22+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
2323pub enum IsNormalizesToHack {
2424 Yes ,
2525 No ,
2626}
2727
28- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
2928pub struct RootGoalEvaluation < ' tcx > {
3029 pub goal : Goal < ' tcx , ty:: Predicate < ' tcx > > ,
3130 pub orig_values : Vec < ty:: GenericArg < ' tcx > > ,
3231 pub evaluation : CanonicalGoalEvaluation < ' tcx > ,
3332 pub returned_goals : Vec < Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
3433}
3534
36- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
3735pub struct NestedGoalEvaluation < ' tcx > {
3836 pub goal : CanonicalState < ' tcx , Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
3937 pub orig_values : CanonicalState < ' tcx , Vec < ty:: GenericArg < ' tcx > > > ,
@@ -42,14 +40,12 @@ pub struct NestedGoalEvaluation<'tcx> {
4240 pub returned_goals : Vec < CanonicalState < ' tcx , Goal < ' tcx , ty:: Predicate < ' tcx > > > > ,
4341}
4442
45- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
4643pub struct CanonicalGoalEvaluation < ' tcx > {
4744 pub goal : CanonicalInput < ' tcx > ,
4845 pub data : GoalEvaluationData < ' tcx > ,
4946 pub result : QueryResult < ' tcx > ,
5047}
5148
52- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
5349pub enum GoalEvaluationData < ' tcx > {
5450 CacheHit ( CacheHit ) ,
5551 Uncached { revisions : Vec < GoalEvaluationStep < ' tcx > > } ,
@@ -60,38 +56,39 @@ impl Debug for RootGoalEvaluation<'_> {
6056 }
6157}
6258
63- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
6459pub struct AddedGoalsEvaluation < ' tcx > {
6560 pub evaluations : Vec < Vec < NestedGoalEvaluation < ' tcx > > > ,
6661 pub result : Result < Certainty , NoSolution > ,
6762}
6863
69- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
7064pub struct GoalEvaluationStep < ' tcx > {
7165 pub added_goals_evaluations : Vec < AddedGoalsEvaluation < ' tcx > > ,
7266 pub candidates : Vec < GoalCandidate < ' tcx > > ,
7367
7468 pub result : QueryResult < ' tcx > ,
7569}
7670
77- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
7871pub struct GoalCandidate < ' tcx > {
7972 pub added_goals_evaluations : Vec < AddedGoalsEvaluation < ' tcx > > ,
8073 pub candidates : Vec < GoalCandidate < ' tcx > > ,
81- pub kind : CandidateKind < ' tcx > ,
74+ pub kind : ProbeKind < ' tcx > ,
8275}
8376
84- #[ derive( Eq , PartialEq , Debug , Hash , HashStable ) ]
85- pub enum CandidateKind < ' tcx > {
77+ #[ derive( Debug , PartialEq , Eq ) ]
78+ pub enum ProbeKind < ' tcx > {
8679 /// Probe entered when normalizing the self ty during candidate assembly
8780 NormalizedSelfTyAssembly ,
88- /// A normal candidate for proving a goal
89- Candidate { name : String , result : QueryResult < ' tcx > } ,
81+ /// Some candidate to prove the current goal.
82+ ///
83+ /// FIXME: Remove this in favor of always using more strongly typed variants.
84+ MiscCandidate { name : String , result : QueryResult < ' tcx > } ,
85+ /// A candidate for proving a trait or alias-relate goal.
86+ TraitCandidate { source : CandidateSource , result : QueryResult < ' tcx > } ,
9087 /// Used in the probe that wraps normalizing the non-self type for the unsize
9188 /// trait, which is also structurally matched on.
9289 UnsizeAssembly ,
9390 /// During upcasting from some source object to target object type, used to
9491 /// do a probe to find out what projection type(s) may be used to prove that
9592 /// the source type upholds all of the target type's object bounds.
96- UpcastProbe ,
93+ UpcastProjectionCompatibility ,
9794}
0 commit comments