1
1
use super :: {
2
- CanonicalInput , Certainty , Goal , IsNormalizesToHack , NoSolution , QueryInput , QueryResult ,
2
+ CandidateSource , CanonicalInput , Certainty , Goal , IsNormalizesToHack , NoSolution , QueryInput ,
3
+ QueryResult ,
3
4
} ;
4
5
use crate :: ty;
5
6
use format:: ProofTreeFormatter ;
6
7
use std:: fmt:: { Debug , Write } ;
7
8
8
9
mod format;
9
10
10
- #[ derive( Eq , PartialEq , Debug , Hash , HashStable ) ]
11
+ #[ derive( Debug , Eq , PartialEq ) ]
11
12
pub enum CacheHit {
12
13
Provisional ,
13
14
Global ,
14
15
}
15
16
16
- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
17
+ #[ derive( Eq , PartialEq ) ]
17
18
pub struct GoalEvaluation < ' tcx > {
18
19
pub uncanonicalized_goal : Goal < ' tcx , ty:: Predicate < ' tcx > > ,
19
20
pub is_normalizes_to_hack : IsNormalizesToHack ,
20
21
pub evaluation : CanonicalGoalEvaluation < ' tcx > ,
21
22
pub returned_goals : Vec < Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
22
23
}
23
24
24
- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
25
+ #[ derive( Eq , PartialEq ) ]
25
26
pub struct CanonicalGoalEvaluation < ' tcx > {
26
27
pub goal : CanonicalInput < ' tcx > ,
27
28
pub kind : GoalEvaluationKind < ' tcx > ,
28
29
pub result : QueryResult < ' tcx > ,
29
30
}
30
31
31
- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
32
+ #[ derive( Eq , PartialEq ) ]
32
33
pub enum GoalEvaluationKind < ' tcx > {
33
34
CacheHit ( CacheHit ) ,
34
35
Uncached { revisions : Vec < GoalEvaluationStep < ' tcx > > } ,
@@ -39,13 +40,13 @@ impl Debug for GoalEvaluation<'_> {
39
40
}
40
41
}
41
42
42
- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
43
+ #[ derive( Eq , PartialEq ) ]
43
44
pub struct AddedGoalsEvaluation < ' tcx > {
44
45
pub evaluations : Vec < Vec < GoalEvaluation < ' tcx > > > ,
45
46
pub result : Result < Certainty , NoSolution > ,
46
47
}
47
48
48
- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
49
+ #[ derive( Eq , PartialEq ) ]
49
50
pub struct GoalEvaluationStep < ' tcx > {
50
51
pub instantiated_goal : QueryInput < ' tcx , ty:: Predicate < ' tcx > > ,
51
52
@@ -55,24 +56,28 @@ pub struct GoalEvaluationStep<'tcx> {
55
56
pub result : QueryResult < ' tcx > ,
56
57
}
57
58
58
- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
59
+ #[ derive( Eq , PartialEq ) ]
59
60
pub struct GoalCandidate < ' tcx > {
60
61
pub added_goals_evaluations : Vec < AddedGoalsEvaluation < ' tcx > > ,
61
62
pub candidates : Vec < GoalCandidate < ' tcx > > ,
62
- pub kind : CandidateKind < ' tcx > ,
63
+ pub kind : ProbeKind < ' tcx > ,
63
64
}
64
65
65
- #[ derive( Eq , PartialEq , Debug , Hash , HashStable ) ]
66
- pub enum CandidateKind < ' tcx > {
66
+ #[ derive( Debug , PartialEq , Eq ) ]
67
+ pub enum ProbeKind < ' tcx > {
67
68
/// Probe entered when normalizing the self ty during candidate assembly
68
69
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 > } ,
71
76
/// Used in the probe that wraps normalizing the non-self type for the unsize
72
77
/// trait, which is also structurally matched on.
73
78
UnsizeAssembly ,
74
79
/// During upcasting from some source object to target object type, used to
75
80
/// do a probe to find out what projection type(s) may be used to prove that
76
81
/// the source type upholds all of the target type's object bounds.
77
- UpcastProbe ,
82
+ UpcastProjectionCompatibility ,
78
83
}
0 commit comments