From e06c62cd5bd84e109f8fe409102c446f53b7f4c9 Mon Sep 17 00:00:00 2001 From: Boxy Date: Fri, 17 Mar 2023 14:04:39 +0000 Subject: [PATCH] UNACEPTABLE --- compiler/rustc_trait_selection/src/solve/eval_ctxt.rs | 6 +++--- compiler/rustc_trait_selection/src/solve/mod.rs | 10 +++++----- .../rustc_trait_selection/src/solve/project_goals.rs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs b/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs index be138e0ab54..80828d5c1d5 100644 --- a/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs +++ b/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs @@ -43,17 +43,17 @@ pub(super) enum IsNormalizesToHack { #[derive(Debug, Clone)] pub(super) struct NestedGoals<'tcx> { - pub(super) projection_eq_hack_goal: Option>>, + pub(super) normalizes_to_hack_goal: Option>>, pub(super) goals: Vec>>, } impl NestedGoals<'_> { pub(super) fn new() -> Self { - Self { projection_eq_hack_goal: None, goals: Vec::new() } + Self { normalizes_to_hack_goal: None, goals: Vec::new() } } pub(super) fn is_empty(&self) -> bool { - self.projection_eq_hack_goal.is_none() && self.goals.is_empty() + self.normalizes_to_hack_goal.is_none() && self.goals.is_empty() } } diff --git a/compiler/rustc_trait_selection/src/solve/mod.rs b/compiler/rustc_trait_selection/src/solve/mod.rs index ba68ff1c2e3..13d6602b7e1 100644 --- a/compiler/rustc_trait_selection/src/solve/mod.rs +++ b/compiler/rustc_trait_selection/src/solve/mod.rs @@ -406,12 +406,12 @@ fn compute_const_arg_has_type_goal( impl<'tcx> EvalCtxt<'_, 'tcx> { #[instrument(level = "debug", skip(self))] - fn set_projection_eq_hack_goal(&mut self, goal: Goal<'tcx, ty::ProjectionPredicate<'tcx>>) { + fn set_normalizes_to_hack_goal(&mut self, goal: Goal<'tcx, ty::ProjectionPredicate<'tcx>>) { assert!( - self.nested_goals.projection_eq_hack_goal.is_none(), + self.nested_goals.normalizes_to_hack_goal.is_none(), "attempted to set the projection eq hack goal when one already exists" ); - self.nested_goals.projection_eq_hack_goal = Some(goal); + self.nested_goals.normalizes_to_hack_goal = Some(goal); } #[instrument(level = "debug", skip(self))] @@ -438,7 +438,7 @@ fn try_evaluate_added_goals(&mut self) -> Result { |this| { let mut has_changed = Err(Certainty::Yes); - if let Some(goal) = goals.projection_eq_hack_goal.take() { + if let Some(goal) = goals.normalizes_to_hack_goal.take() { let (_, certainty) = match this.evaluate_goal( IsNormalizesToHack::Yes, goal.with(this.tcx(), ty::Binder::dummy(goal.predicate)), @@ -475,7 +475,7 @@ fn try_evaluate_added_goals(&mut self) -> Result { term, projection_ty: goal.predicate.projection_ty, }; - new_goals.projection_eq_hack_goal = + new_goals.normalizes_to_hack_goal = Some(goal.with(this.tcx(), projection_pred)); has_changed = has_changed.map_err(|c| c.unify_and(certainty)); diff --git a/compiler/rustc_trait_selection/src/solve/project_goals.rs b/compiler/rustc_trait_selection/src/solve/project_goals.rs index b054a2bda1f..93d77c39f95 100644 --- a/compiler/rustc_trait_selection/src/solve/project_goals.rs +++ b/compiler/rustc_trait_selection/src/solve/project_goals.rs @@ -43,7 +43,7 @@ pub(super) fn compute_projection_goal( term: unconstrained_rhs, }; - self.set_projection_eq_hack_goal(goal.with(self.tcx(), unconstrained_predicate)); + self.set_normalizes_to_hack_goal(goal.with(self.tcx(), unconstrained_predicate)); self.try_evaluate_added_goals()?; self.eq(goal.param_env, unconstrained_rhs, predicate.term)?; self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)