mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Rollup merge of #132026 - lcnr:stabilize-coherence-again, r=compiler-errors
analyse: remove unused uncanonicalized field
This field is unused and was only relevant when actually printing proof trees. Right now this simply causes proof tree building to leak a bunch of inference vars 😁
r? ``@compiler-errors``
This commit is contained in:
commit
5b602201ed
@ -170,7 +170,7 @@ where
|
||||
//
|
||||
// We don't do so for `NormalizesTo` goals as we erased the expected term and
|
||||
// bailing with overflow here would prevent us from detecting a type-mismatch,
|
||||
// causing a coherence error in diesel, see #131969. We still bail with verflow
|
||||
// causing a coherence error in diesel, see #131969. We still bail with overflow
|
||||
// when later returning from the parent AliasRelate goal.
|
||||
if !self.is_normalizes_to_goal {
|
||||
let num_non_region_vars =
|
||||
|
@ -291,7 +291,7 @@ where
|
||||
search_graph,
|
||||
nested_goals: NestedGoals::new(),
|
||||
tainted: Ok(()),
|
||||
inspect: canonical_goal_evaluation.new_goal_evaluation_step(var_values, input),
|
||||
inspect: canonical_goal_evaluation.new_goal_evaluation_step(var_values),
|
||||
};
|
||||
|
||||
for &(key, ty) in &input.predefined_opaques_in_body.opaque_types {
|
||||
|
@ -13,7 +13,7 @@ use rustc_type_ir::{self as ty, Interner};
|
||||
use crate::delegate::SolverDelegate;
|
||||
use crate::solve::eval_ctxt::canonical;
|
||||
use crate::solve::{
|
||||
CanonicalInput, Certainty, GenerateProofTree, Goal, GoalEvaluationKind, GoalSource, QueryInput,
|
||||
CanonicalInput, Certainty, GenerateProofTree, Goal, GoalEvaluationKind, GoalSource,
|
||||
QueryResult, inspect,
|
||||
};
|
||||
|
||||
@ -119,6 +119,9 @@ impl<I: Interner> WipCanonicalGoalEvaluation<I> {
|
||||
}
|
||||
}
|
||||
|
||||
/// This only exists during proof tree building and does not have
|
||||
/// a corresponding struct in `inspect`. We need this to track a
|
||||
/// bunch of metadata about the current evaluation.
|
||||
#[derive_where(PartialEq, Eq, Debug; I: Interner)]
|
||||
struct WipCanonicalGoalEvaluationStep<I: Interner> {
|
||||
/// Unlike `EvalCtxt::var_values`, we append a new
|
||||
@ -128,7 +131,6 @@ struct WipCanonicalGoalEvaluationStep<I: Interner> {
|
||||
/// This is necessary as we otherwise don't unify these
|
||||
/// vars when instantiating multiple `CanonicalState`.
|
||||
var_values: Vec<I::GenericArg>,
|
||||
instantiated_goal: QueryInput<I, I::Predicate>,
|
||||
probe_depth: usize,
|
||||
evaluation: WipProbe<I>,
|
||||
}
|
||||
@ -145,16 +147,12 @@ impl<I: Interner> WipCanonicalGoalEvaluationStep<I> {
|
||||
current
|
||||
}
|
||||
|
||||
fn finalize(self) -> inspect::CanonicalGoalEvaluationStep<I> {
|
||||
fn finalize(self) -> inspect::Probe<I> {
|
||||
let evaluation = self.evaluation.finalize();
|
||||
match evaluation.kind {
|
||||
inspect::ProbeKind::Root { .. } => (),
|
||||
inspect::ProbeKind::Root { .. } => evaluation,
|
||||
_ => unreachable!("unexpected root evaluation: {evaluation:?}"),
|
||||
}
|
||||
inspect::CanonicalGoalEvaluationStep {
|
||||
instantiated_goal: self.instantiated_goal,
|
||||
evaluation,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -328,11 +326,9 @@ impl<D: SolverDelegate<Interner = I>, I: Interner> ProofTreeBuilder<D> {
|
||||
pub(crate) fn new_goal_evaluation_step(
|
||||
&mut self,
|
||||
var_values: ty::CanonicalVarValues<I>,
|
||||
instantiated_goal: QueryInput<I, I::Predicate>,
|
||||
) -> ProofTreeBuilder<D> {
|
||||
self.nested(|| WipCanonicalGoalEvaluationStep {
|
||||
var_values: var_values.var_values.to_vec(),
|
||||
instantiated_goal,
|
||||
evaluation: WipProbe {
|
||||
initial_num_var_values: var_values.len(),
|
||||
steps: vec![],
|
||||
|
@ -344,7 +344,7 @@ impl<'a, 'tcx> InspectGoal<'a, 'tcx> {
|
||||
};
|
||||
|
||||
let mut nested_goals = vec![];
|
||||
self.candidates_recur(&mut candidates, &mut nested_goals, &last_eval_step.evaluation);
|
||||
self.candidates_recur(&mut candidates, &mut nested_goals, &last_eval_step);
|
||||
|
||||
candidates
|
||||
}
|
||||
|
@ -23,9 +23,7 @@ use std::hash::Hash;
|
||||
use derive_where::derive_where;
|
||||
use rustc_type_ir_macros::{TypeFoldable_Generic, TypeVisitable_Generic};
|
||||
|
||||
use crate::solve::{
|
||||
CandidateSource, CanonicalInput, Certainty, Goal, GoalSource, QueryInput, QueryResult,
|
||||
};
|
||||
use crate::solve::{CandidateSource, CanonicalInput, Certainty, Goal, GoalSource, QueryResult};
|
||||
use crate::{Canonical, CanonicalVarValues, Interner};
|
||||
|
||||
/// Some `data` together with information about how they relate to the input
|
||||
@ -69,15 +67,10 @@ pub struct CanonicalGoalEvaluation<I: Interner> {
|
||||
#[derive_where(PartialEq, Eq, Hash, Debug; I: Interner)]
|
||||
pub enum CanonicalGoalEvaluationKind<I: Interner> {
|
||||
Overflow,
|
||||
Evaluation { final_revision: CanonicalGoalEvaluationStep<I> },
|
||||
}
|
||||
|
||||
#[derive_where(PartialEq, Eq, Hash, Debug; I: Interner)]
|
||||
pub struct CanonicalGoalEvaluationStep<I: Interner> {
|
||||
pub instantiated_goal: QueryInput<I, I::Predicate>,
|
||||
|
||||
/// The actual evaluation of the goal, always `ProbeKind::Root`.
|
||||
pub evaluation: Probe<I>,
|
||||
Evaluation {
|
||||
/// This is always `ProbeKind::Root`.
|
||||
final_revision: Probe<I>,
|
||||
},
|
||||
}
|
||||
|
||||
/// A self-contained computation during trait solving. This either
|
||||
|
Loading…
Reference in New Issue
Block a user