Skip to content

Commit d6ce2bd

Browse files
committed
remove unused field
1 parent 25365ae commit d6ce2bd

File tree

4 files changed

+13
-24
lines changed

4 files changed

+13
-24
lines changed

compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ where
291291
search_graph,
292292
nested_goals: NestedGoals::new(),
293293
tainted: Ok(()),
294-
inspect: canonical_goal_evaluation.new_goal_evaluation_step(var_values, input),
294+
inspect: canonical_goal_evaluation.new_goal_evaluation_step(var_values),
295295
};
296296

297297
for &(key, ty) in &input.predefined_opaques_in_body.opaque_types {

compiler/rustc_next_trait_solver/src/solve/inspect/build.rs

+6-10
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_type_ir::{self as ty, Interner};
1313
use crate::delegate::SolverDelegate;
1414
use crate::solve::eval_ctxt::canonical;
1515
use crate::solve::{
16-
CanonicalInput, Certainty, GenerateProofTree, Goal, GoalEvaluationKind, GoalSource, QueryInput,
16+
CanonicalInput, Certainty, GenerateProofTree, Goal, GoalEvaluationKind, GoalSource,
1717
QueryResult, inspect,
1818
};
1919

@@ -119,6 +119,9 @@ impl<I: Interner> WipCanonicalGoalEvaluation<I> {
119119
}
120120
}
121121

122+
/// This only exists during proof tree building and does not have
123+
/// a corresponding struct in `inspect`. We need this to track a
124+
/// bunch of metadata about the current evaluation.
122125
#[derive_where(PartialEq, Eq, Debug; I: Interner)]
123126
struct WipCanonicalGoalEvaluationStep<I: Interner> {
124127
/// Unlike `EvalCtxt::var_values`, we append a new
@@ -128,7 +131,6 @@ struct WipCanonicalGoalEvaluationStep<I: Interner> {
128131
/// This is necessary as we otherwise don't unify these
129132
/// vars when instantiating multiple `CanonicalState`.
130133
var_values: Vec<I::GenericArg>,
131-
instantiated_goal: QueryInput<I, I::Predicate>,
132134
probe_depth: usize,
133135
evaluation: WipProbe<I>,
134136
}
@@ -145,16 +147,12 @@ impl<I: Interner> WipCanonicalGoalEvaluationStep<I> {
145147
current
146148
}
147149

148-
fn finalize(self) -> inspect::CanonicalGoalEvaluationStep<I> {
150+
fn finalize(self) -> inspect::Probe<I> {
149151
let evaluation = self.evaluation.finalize();
150152
match evaluation.kind {
151-
inspect::ProbeKind::Root { .. } => (),
153+
inspect::ProbeKind::Root { .. } => evaluation,
152154
_ => unreachable!("unexpected root evaluation: {evaluation:?}"),
153155
}
154-
inspect::CanonicalGoalEvaluationStep {
155-
instantiated_goal: self.instantiated_goal,
156-
evaluation,
157-
}
158156
}
159157
}
160158

@@ -328,11 +326,9 @@ impl<D: SolverDelegate<Interner = I>, I: Interner> ProofTreeBuilder<D> {
328326
pub(crate) fn new_goal_evaluation_step(
329327
&mut self,
330328
var_values: ty::CanonicalVarValues<I>,
331-
instantiated_goal: QueryInput<I, I::Predicate>,
332329
) -> ProofTreeBuilder<D> {
333330
self.nested(|| WipCanonicalGoalEvaluationStep {
334331
var_values: var_values.var_values.to_vec(),
335-
instantiated_goal,
336332
evaluation: WipProbe {
337333
initial_num_var_values: var_values.len(),
338334
steps: vec![],

compiler/rustc_trait_selection/src/solve/inspect/analyse.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ impl<'a, 'tcx> InspectGoal<'a, 'tcx> {
344344
};
345345

346346
let mut nested_goals = vec![];
347-
self.candidates_recur(&mut candidates, &mut nested_goals, &last_eval_step.evaluation);
347+
self.candidates_recur(&mut candidates, &mut nested_goals, &last_eval_step);
348348

349349
candidates
350350
}

compiler/rustc_type_ir/src/solve/inspect.rs

+5-12
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ use std::hash::Hash;
2323
use derive_where::derive_where;
2424
use rustc_type_ir_macros::{TypeFoldable_Generic, TypeVisitable_Generic};
2525

26-
use crate::solve::{
27-
CandidateSource, CanonicalInput, Certainty, Goal, GoalSource, QueryInput, QueryResult,
28-
};
26+
use crate::solve::{CandidateSource, CanonicalInput, Certainty, Goal, GoalSource, QueryResult};
2927
use crate::{Canonical, CanonicalVarValues, Interner};
3028

3129
/// Some `data` together with information about how they relate to the input
@@ -69,15 +67,10 @@ pub struct CanonicalGoalEvaluation<I: Interner> {
6967
#[derive_where(PartialEq, Eq, Hash, Debug; I: Interner)]
7068
pub enum CanonicalGoalEvaluationKind<I: Interner> {
7169
Overflow,
72-
Evaluation { final_revision: CanonicalGoalEvaluationStep<I> },
73-
}
74-
75-
#[derive_where(PartialEq, Eq, Hash, Debug; I: Interner)]
76-
pub struct CanonicalGoalEvaluationStep<I: Interner> {
77-
pub instantiated_goal: QueryInput<I, I::Predicate>,
78-
79-
/// The actual evaluation of the goal, always `ProbeKind::Root`.
80-
pub evaluation: Probe<I>,
70+
Evaluation {
71+
/// This is always `ProbeKind::Root`.
72+
final_revision: Probe<I>,
73+
},
8174
}
8275

8376
/// A self-contained computation during trait solving. This either

0 commit comments

Comments
 (0)