diff options
| author | lcnr <rust@lcnr.de> | 2023-08-14 11:29:42 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2023-09-11 11:51:32 +0200 |
| commit | fc452e2ed3a173dfbfc28fce8bca08170da53111 (patch) | |
| tree | 5e586bea7eadb1ee22fe5efad8750ec095460e86 /compiler/rustc_middle/src/traits/solve/inspect.rs | |
| parent | 7d1e416d3234bdfed6443dc2e4301f2d6f063525 (diff) | |
| download | rust-fc452e2ed3a173dfbfc28fce8bca08170da53111.tar.gz rust-fc452e2ed3a173dfbfc28fce8bca08170da53111.zip | |
split GoalEvaluation and CanonicalGoalEvaluation
the unnormalized goal is in the callers inference context, while anything inside of the `CanonicalGoalEvaluation` is inside of a new one.
Diffstat (limited to 'compiler/rustc_middle/src/traits/solve/inspect.rs')
| -rw-r--r-- | compiler/rustc_middle/src/traits/solve/inspect.rs | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/compiler/rustc_middle/src/traits/solve/inspect.rs b/compiler/rustc_middle/src/traits/solve/inspect.rs index 4e2af3816ac..dc51ded1b80 100644 --- a/compiler/rustc_middle/src/traits/solve/inspect.rs +++ b/compiler/rustc_middle/src/traits/solve/inspect.rs @@ -16,12 +16,15 @@ pub enum CacheHit { #[derive(Eq, PartialEq, Hash, HashStable)] pub struct GoalEvaluation<'tcx> { pub uncanonicalized_goal: Goal<'tcx, ty::Predicate<'tcx>>, - pub canonicalized_goal: CanonicalInput<'tcx>, - - pub kind: GoalEvaluationKind<'tcx>, pub is_normalizes_to_hack: IsNormalizesToHack, + pub evaluation: CanonicalGoalEvaluation<'tcx>, pub returned_goals: Vec<Goal<'tcx, ty::Predicate<'tcx>>>, +} +#[derive(Eq, PartialEq, Hash, HashStable)] +pub struct CanonicalGoalEvaluation<'tcx> { + pub goal: CanonicalInput<'tcx>, + pub kind: GoalEvaluationKind<'tcx>, pub result: QueryResult<'tcx>, } @@ -41,30 +44,20 @@ pub struct AddedGoalsEvaluation<'tcx> { pub evaluations: Vec<Vec<GoalEvaluation<'tcx>>>, pub result: Result<Certainty, NoSolution>, } -impl Debug for AddedGoalsEvaluation<'_> { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - ProofTreeFormatter::new(f).format_nested_goal_evaluation(self) - } -} #[derive(Eq, PartialEq, Hash, HashStable)] pub struct GoalEvaluationStep<'tcx> { pub instantiated_goal: QueryInput<'tcx, ty::Predicate<'tcx>>, - pub nested_goal_evaluations: Vec<AddedGoalsEvaluation<'tcx>>, + pub added_goals_evaluations: Vec<AddedGoalsEvaluation<'tcx>>, pub candidates: Vec<GoalCandidate<'tcx>>, pub result: QueryResult<'tcx>, } -impl Debug for GoalEvaluationStep<'_> { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - ProofTreeFormatter::new(f).format_evaluation_step(self) - } -} #[derive(Eq, PartialEq, Hash, HashStable)] pub struct GoalCandidate<'tcx> { - pub nested_goal_evaluations: Vec<AddedGoalsEvaluation<'tcx>>, + pub added_goals_evaluations: Vec<AddedGoalsEvaluation<'tcx>>, pub candidates: Vec<GoalCandidate<'tcx>>, pub kind: CandidateKind<'tcx>, } @@ -83,8 +76,3 @@ pub enum CandidateKind<'tcx> { /// the source type upholds all of the target type's object bounds. UpcastProbe, } -impl Debug for GoalCandidate<'_> { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - ProofTreeFormatter::new(f).format_candidate(self) - } -} |
