1
- use super :: { CanonicalInput , Certainty , Goal , NoSolution , QueryResult } ;
1
+ use super :: { CandidateSource , CanonicalInput , Certainty , Goal , NoSolution , QueryResult } ;
2
2
use crate :: infer:: canonical:: { Canonical , CanonicalVarValues } ;
3
3
use crate :: ty;
4
4
use format:: ProofTreeFormatter ;
@@ -13,27 +13,25 @@ pub struct State<'tcx, T> {
13
13
}
14
14
pub type CanonicalState < ' tcx , T > = Canonical < ' tcx , State < ' tcx , T > > ;
15
15
16
- #[ derive( Eq , PartialEq , Debug , Hash , HashStable ) ]
16
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
17
17
pub enum CacheHit {
18
18
Provisional ,
19
19
Global ,
20
20
}
21
21
22
- #[ derive( Debug , PartialEq , Eq , Hash , HashStable ) ]
22
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
23
23
pub enum IsNormalizesToHack {
24
24
Yes ,
25
25
No ,
26
26
}
27
27
28
- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
29
28
pub struct RootGoalEvaluation < ' tcx > {
30
29
pub goal : Goal < ' tcx , ty:: Predicate < ' tcx > > ,
31
30
pub orig_values : Vec < ty:: GenericArg < ' tcx > > ,
32
31
pub evaluation : CanonicalGoalEvaluation < ' tcx > ,
33
32
pub returned_goals : Vec < Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
34
33
}
35
34
36
- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
37
35
pub struct NestedGoalEvaluation < ' tcx > {
38
36
pub goal : CanonicalState < ' tcx , Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
39
37
pub orig_values : CanonicalState < ' tcx , Vec < ty:: GenericArg < ' tcx > > > ,
@@ -42,14 +40,12 @@ pub struct NestedGoalEvaluation<'tcx> {
42
40
pub returned_goals : Vec < CanonicalState < ' tcx , Goal < ' tcx , ty:: Predicate < ' tcx > > > > ,
43
41
}
44
42
45
- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
46
43
pub struct CanonicalGoalEvaluation < ' tcx > {
47
44
pub goal : CanonicalInput < ' tcx > ,
48
45
pub data : GoalEvaluationData < ' tcx > ,
49
46
pub result : QueryResult < ' tcx > ,
50
47
}
51
48
52
- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
53
49
pub enum GoalEvaluationData < ' tcx > {
54
50
CacheHit ( CacheHit ) ,
55
51
Uncached { revisions : Vec < GoalEvaluationStep < ' tcx > > } ,
@@ -60,38 +56,39 @@ impl Debug for RootGoalEvaluation<'_> {
60
56
}
61
57
}
62
58
63
- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
64
59
pub struct AddedGoalsEvaluation < ' tcx > {
65
60
pub evaluations : Vec < Vec < NestedGoalEvaluation < ' tcx > > > ,
66
61
pub result : Result < Certainty , NoSolution > ,
67
62
}
68
63
69
- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
70
64
pub struct GoalEvaluationStep < ' tcx > {
71
65
pub added_goals_evaluations : Vec < AddedGoalsEvaluation < ' tcx > > ,
72
66
pub candidates : Vec < GoalCandidate < ' tcx > > ,
73
67
74
68
pub result : QueryResult < ' tcx > ,
75
69
}
76
70
77
- #[ derive( Eq , PartialEq , Hash , HashStable ) ]
78
71
pub struct GoalCandidate < ' tcx > {
79
72
pub added_goals_evaluations : Vec < AddedGoalsEvaluation < ' tcx > > ,
80
73
pub candidates : Vec < GoalCandidate < ' tcx > > ,
81
- pub kind : CandidateKind < ' tcx > ,
74
+ pub kind : ProbeKind < ' tcx > ,
82
75
}
83
76
84
- #[ derive( Eq , PartialEq , Debug , Hash , HashStable ) ]
85
- pub enum CandidateKind < ' tcx > {
77
+ #[ derive( Debug , PartialEq , Eq ) ]
78
+ pub enum ProbeKind < ' tcx > {
86
79
/// Probe entered when normalizing the self ty during candidate assembly
87
80
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 > } ,
90
87
/// Used in the probe that wraps normalizing the non-self type for the unsize
91
88
/// trait, which is also structurally matched on.
92
89
UnsizeAssembly ,
93
90
/// During upcasting from some source object to target object type, used to
94
91
/// do a probe to find out what projection type(s) may be used to prove that
95
92
/// the source type upholds all of the target type's object bounds.
96
- UpcastProbe ,
93
+ UpcastProjectionCompatibility ,
97
94
}
0 commit comments