11use super :: {
2- CanonicalInput , Certainty , Goal , IsNormalizesToHack , NoSolution , QueryInput , QueryResult ,
2+ CandidateSource , CanonicalInput , Certainty , Goal , IsNormalizesToHack , NoSolution , QueryInput ,
3+ QueryResult ,
34} ;
45use crate :: ty;
56use format:: ProofTreeFormatter ;
67use std:: fmt:: { Debug , Write } ;
78
89mod format;
910
10- #[ derive( Eq , PartialEq , Debug , Hash , HashStable ) ]
11+ #[ derive( Debug , Eq , PartialEq ) ]
1112pub enum CacheHit {
1213 Provisional ,
1314 Global ,
1415}
1516
16- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
17+ #[ derive( Eq , PartialEq ) ]
1718pub struct GoalEvaluation < ' tcx > {
1819 pub uncanonicalized_goal : Goal < ' tcx , ty:: Predicate < ' tcx > > ,
1920 pub is_normalizes_to_hack : IsNormalizesToHack ,
2021 pub evaluation : CanonicalGoalEvaluation < ' tcx > ,
2122 pub returned_goals : Vec < Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
2223}
2324
24- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
25+ #[ derive( Eq , PartialEq ) ]
2526pub struct CanonicalGoalEvaluation < ' tcx > {
2627 pub goal : CanonicalInput < ' tcx > ,
2728 pub kind : GoalEvaluationKind < ' tcx > ,
2829 pub result : QueryResult < ' tcx > ,
2930}
3031
31- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
32+ #[ derive( Eq , PartialEq ) ]
3233pub enum GoalEvaluationKind < ' tcx > {
3334 CacheHit ( CacheHit ) ,
3435 Uncached { revisions : Vec < GoalEvaluationStep < ' tcx > > } ,
@@ -39,13 +40,13 @@ impl Debug for GoalEvaluation<'_> {
3940 }
4041}
4142
42- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
43+ #[ derive( Eq , PartialEq ) ]
4344pub struct AddedGoalsEvaluation < ' tcx > {
4445 pub evaluations : Vec < Vec < GoalEvaluation < ' tcx > > > ,
4546 pub result : Result < Certainty , NoSolution > ,
4647}
4748
48- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
49+ #[ derive( Eq , PartialEq ) ]
4950pub struct GoalEvaluationStep < ' tcx > {
5051 pub instantiated_goal : QueryInput < ' tcx , ty:: Predicate < ' tcx > > ,
5152
@@ -55,24 +56,28 @@ pub struct GoalEvaluationStep<'tcx> {
5556 pub result : QueryResult < ' tcx > ,
5657}
5758
58- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
59+ #[ derive( Eq , PartialEq ) ]
5960pub struct GoalCandidate < ' tcx > {
6061 pub added_goals_evaluations : Vec < AddedGoalsEvaluation < ' tcx > > ,
6162 pub candidates : Vec < GoalCandidate < ' tcx > > ,
62- pub kind : CandidateKind < ' tcx > ,
63+ pub kind : ProbeKind < ' tcx > ,
6364}
6465
65- #[ derive( Eq , PartialEq , Debug , Hash , HashStable ) ]
66- pub enum CandidateKind < ' tcx > {
66+ #[ derive( Debug , PartialEq , Eq ) ]
67+ pub enum ProbeKind < ' tcx > {
6768 /// Probe entered when normalizing the self ty during candidate assembly
6869 NormalizedSelfTyAssembly ,
69- /// A normal candidate for proving a goal
70- Candidate { name : String , result : QueryResult < ' tcx > } ,
70+ /// Some candidate to prove the current goal.
71+ ///
72+ /// FIXME: Remove this in favor of always using more strongly typed variants.
73+ MiscCandidate { name : & ' static str , result : QueryResult < ' tcx > } ,
74+ /// A candidate for proving a trait or alias-relate goal.
75+ TraitCandidate { source : CandidateSource , result : QueryResult < ' tcx > } ,
7176 /// Used in the probe that wraps normalizing the non-self type for the unsize
7277 /// trait, which is also structurally matched on.
7378 UnsizeAssembly ,
7479 /// During upcasting from some source object to target object type, used to
7580 /// do a probe to find out what projection type(s) may be used to prove that
7681 /// the source type upholds all of the target type's object bounds.
77- UpcastProbe ,
82+ UpcastProjectionCompatibility ,
7883}
0 commit comments