Unnamed repository; edit this file 'description' to name the repository.
| -rw-r--r-- | crates/hir-ty/src/autoderef.rs | 2 | ||||
| -rw-r--r-- | crates/hir-ty/src/infer/coerce.rs | 6 | ||||
| -rw-r--r-- | crates/hir-ty/src/infer/expr.rs | 2 | ||||
| -rw-r--r-- | crates/hir-ty/src/infer/unify.rs | 2 | ||||
| -rw-r--r-- | crates/hir-ty/src/method_resolution.rs | 4 | ||||
| -rw-r--r-- | crates/hir-ty/src/next_solver/fulfill.rs | 14 | ||||
| -rw-r--r-- | crates/hir-ty/src/next_solver/inspect.rs | 2 | ||||
| -rw-r--r-- | crates/hir-ty/src/next_solver/normalize.rs | 4 | ||||
| -rw-r--r-- | crates/hir-ty/src/next_solver/obligation_ctxt.rs | 8 | ||||
| -rw-r--r-- | crates/hir-ty/src/next_solver/structural_normalize.rs | 2 |
10 files changed, 23 insertions, 23 deletions
diff --git a/crates/hir-ty/src/autoderef.rs b/crates/hir-ty/src/autoderef.rs index 21a86d3e43..4d348ec6b7 100644 --- a/crates/hir-ty/src/autoderef.rs +++ b/crates/hir-ty/src/autoderef.rs @@ -304,7 +304,7 @@ fn structurally_normalize_ty<'db>( // evaluate/fulfill mismatches, but that's not a reason for an ICE. return None; }; - let errors = ocx.select_where_possible(); + let errors = ocx.try_evaluate_obligations(); if !errors.is_empty() { unreachable!(); } diff --git a/crates/hir-ty/src/infer/coerce.rs b/crates/hir-ty/src/infer/coerce.rs index 62ce00a2e3..0ca696ed08 100644 --- a/crates/hir-ty/src/infer/coerce.rs +++ b/crates/hir-ty/src/infer/coerce.rs @@ -160,7 +160,7 @@ impl<'a, 'b, 'db> Coerce<'a, 'b, 'db> { Ok(InferOk { value, obligations }) => { let mut ocx = ObligationCtxt::new(this.infer_ctxt()); ocx.register_obligations(obligations); - if ocx.select_where_possible().is_empty() { + if ocx.try_evaluate_obligations().is_empty() { Ok(InferOk { value, obligations: ocx.into_pending_obligations() }) } else { Err(TypeError::Mismatch) @@ -743,7 +743,7 @@ impl<'a, 'b, 'db> Coerce<'a, 'b, 'db> { Some(PredicateKind::AliasRelate(..)) => { let mut ocx = ObligationCtxt::new(self.infer_ctxt()); ocx.register_obligation(obligation); - if !ocx.select_where_possible().is_empty() { + if !ocx.try_evaluate_obligations().is_empty() { return Err(TypeError::Mismatch); } coercion.obligations.extend(ocx.into_pending_obligations()); @@ -1119,7 +1119,7 @@ impl<'db> InferenceContext<'db> { prev_ty, new_ty, )?; - if ocx.select_where_possible().is_empty() { + if ocx.try_evaluate_obligations().is_empty() { Ok(InferOk { value, obligations: ocx.into_pending_obligations() }) } else { Err(TypeError::Mismatch) diff --git a/crates/hir-ty/src/infer/expr.rs b/crates/hir-ty/src/infer/expr.rs index ddf632c1c8..7b404bb854 100644 --- a/crates/hir-ty/src/infer/expr.rs +++ b/crates/hir-ty/src/infer/expr.rs @@ -2151,7 +2151,7 @@ impl<'db> InferenceContext<'db> { expected_output.to_nextsolver(interner), formal_output, )?; - if !ocx.select_where_possible().is_empty() { + if !ocx.try_evaluate_obligations().is_empty() { return Err(crate::next_solver::TypeError::Mismatch); } diff --git a/crates/hir-ty/src/infer/unify.rs b/crates/hir-ty/src/infer/unify.rs index 108cf5b1a2..d8ca029815 100644 --- a/crates/hir-ty/src/infer/unify.rs +++ b/crates/hir-ty/src/infer/unify.rs @@ -818,7 +818,7 @@ impl<'db> InferenceTable<'db> { } pub(crate) fn select_obligations_where_possible(&mut self) { - self.fulfillment_cx.select_where_possible(&self.infer_ctxt); + self.fulfillment_cx.try_evaluate_obligations(&self.infer_ctxt); } pub(super) fn register_predicate( diff --git a/crates/hir-ty/src/method_resolution.rs b/crates/hir-ty/src/method_resolution.rs index 61d3091a0c..9b330d3f3f 100644 --- a/crates/hir-ty/src/method_resolution.rs +++ b/crates/hir-ty/src/method_resolution.rs @@ -1785,7 +1785,7 @@ fn is_valid_trait_method_candidate( let mut ctxt = ObligationCtxt::new(&table.infer_ctxt); ctxt.register_obligations(infer_ok.into_obligations()); // FIXME: Are we doing this correctly? Probably better to follow rustc more closely. - check_that!(ctxt.select_where_possible().is_empty()); + check_that!(ctxt.try_evaluate_obligations().is_empty()); } check_that!(table.unify(receiver_ty, &expected_receiver)); @@ -1871,7 +1871,7 @@ fn is_valid_impl_fn_candidate( ) })); - if ctxt.select_where_possible().is_empty() { + if ctxt.try_evaluate_obligations().is_empty() { IsValidCandidate::Yes } else { IsValidCandidate::No diff --git a/crates/hir-ty/src/next_solver/fulfill.rs b/crates/hir-ty/src/next_solver/fulfill.rs index 34dff37972..262da858d4 100644 --- a/crates/hir-ty/src/next_solver/fulfill.rs +++ b/crates/hir-ty/src/next_solver/fulfill.rs @@ -54,7 +54,7 @@ struct ObligationStorage<'db> { /// Obligations which resulted in an overflow in fulfillment itself. /// /// We cannot eagerly return these as error so we instead store them here - /// to avoid recomputing them each time `select_where_possible` is called. + /// to avoid recomputing them each time `try_evaluate_obligations` is called. /// This also allows us to return the correct `FulfillmentError` for them. overflowed: Vec<PredicateObligation<'db>>, pending: PendingObligations<'db>, @@ -95,7 +95,7 @@ impl<'db> ObligationStorage<'db> { // IMPORTANT: we must not use solve any inference variables in the obligations // as this is all happening inside of a probe. We use a probe to make sure // we get all obligations involved in the overflow. We pretty much check: if - // we were to do another step of `select_where_possible`, which goals would + // we were to do another step of `try_evaluate_obligations`, which goals would // change. // FIXME: <https://github.com/Gankra/thin-vec/pull/66> is merged, this can be removed. self.overflowed.extend( @@ -131,7 +131,7 @@ impl<'db> FulfillmentCtxt<'db> { infcx: &InferCtxt<'db>, obligation: PredicateObligation<'db>, ) { - // FIXME: See the comment in `select_where_possible()`. + // FIXME: See the comment in `try_evaluate_obligations()`. // assert_eq!(self.usable_in_snapshot, infcx.num_open_snapshots()); self.obligations.register(obligation, None); } @@ -141,7 +141,7 @@ impl<'db> FulfillmentCtxt<'db> { infcx: &InferCtxt<'db>, obligations: impl IntoIterator<Item = PredicateObligation<'db>>, ) { - // FIXME: See the comment in `select_where_possible()`. + // FIXME: See the comment in `try_evaluate_obligations()`. // assert_eq!(self.usable_in_snapshot, infcx.num_open_snapshots()); obligations.into_iter().for_each(|obligation| self.obligations.register(obligation, None)); } @@ -158,7 +158,7 @@ impl<'db> FulfillmentCtxt<'db> { .collect() } - pub(crate) fn select_where_possible( + pub(crate) fn try_evaluate_obligations( &mut self, infcx: &InferCtxt<'db>, ) -> Vec<NextSolverError<'db>> { @@ -223,11 +223,11 @@ impl<'db> FulfillmentCtxt<'db> { errors } - pub(crate) fn select_all_or_error( + pub(crate) fn evaluate_obligations_error_on_ambiguity( &mut self, infcx: &InferCtxt<'db>, ) -> Vec<NextSolverError<'db>> { - let errors = self.select_where_possible(infcx); + let errors = self.try_evaluate_obligations(infcx); if !errors.is_empty() { return errors; } diff --git a/crates/hir-ty/src/next_solver/inspect.rs b/crates/hir-ty/src/next_solver/inspect.rs index bc19d51d23..0db4746721 100644 --- a/crates/hir-ty/src/next_solver/inspect.rs +++ b/crates/hir-ty/src/next_solver/inspect.rs @@ -92,7 +92,7 @@ impl<'db> NormalizesToTermHack<'db> { let mut ocx = ObligationCtxt::new(infcx); ocx.eq(&ObligationCause::dummy(), param_env, self.term, self.unconstrained_term)?; f(&mut ocx); - let errors = ocx.select_all_or_error(); + let errors = ocx.evaluate_obligations_error_on_ambiguity(); if errors.is_empty() { Ok(Certainty::Yes) } else if errors.iter().all(|e| !matches!(e, NextSolverError::TrueError(_))) { diff --git a/crates/hir-ty/src/next_solver/normalize.rs b/crates/hir-ty/src/next_solver/normalize.rs index 41cb488440..2f241f8fec 100644 --- a/crates/hir-ty/src/next_solver/normalize.rs +++ b/crates/hir-ty/src/next_solver/normalize.rs @@ -77,7 +77,7 @@ where stalled_coroutine_goals: vec![], }; let value = value.try_fold_with(&mut folder)?; - let errors = folder.fulfill_cx.select_all_or_error(at.infcx); + let errors = folder.fulfill_cx.evaluate_obligations_error_on_ambiguity(at.infcx); if errors.is_empty() { Ok((value, folder.stalled_coroutine_goals)) } else { Err(errors) } } @@ -138,7 +138,7 @@ impl<'db> NormalizationFolder<'_, 'db> { fn select_all_and_stall_coroutine_predicates( &mut self, ) -> Result<(), Vec<NextSolverError<'db>>> { - let errors = self.fulfill_cx.select_where_possible(self.at.infcx); + let errors = self.fulfill_cx.try_evaluate_obligations(self.at.infcx); if !errors.is_empty() { return Err(errors); } diff --git a/crates/hir-ty/src/next_solver/obligation_ctxt.rs b/crates/hir-ty/src/next_solver/obligation_ctxt.rs index 8e2dc0dec4..e85574a882 100644 --- a/crates/hir-ty/src/next_solver/obligation_ctxt.rs +++ b/crates/hir-ty/src/next_solver/obligation_ctxt.rs @@ -144,13 +144,13 @@ impl<'a, 'db> ObligationCtxt<'a, 'db> { } #[must_use] - pub fn select_where_possible(&mut self) -> Vec<NextSolverError<'db>> { - self.engine.select_where_possible(self.infcx) + pub fn try_evaluate_obligations(&mut self) -> Vec<NextSolverError<'db>> { + self.engine.try_evaluate_obligations(self.infcx) } #[must_use] - pub fn select_all_or_error(&mut self) -> Vec<NextSolverError<'db>> { - self.engine.select_all_or_error(self.infcx) + pub fn evaluate_obligations_error_on_ambiguity(&mut self) -> Vec<NextSolverError<'db>> { + self.engine.evaluate_obligations_error_on_ambiguity(self.infcx) } /// Returns the not-yet-processed and stalled obligations from the diff --git a/crates/hir-ty/src/next_solver/structural_normalize.rs b/crates/hir-ty/src/next_solver/structural_normalize.rs index 18859d8b79..00c3708358 100644 --- a/crates/hir-ty/src/next_solver/structural_normalize.rs +++ b/crates/hir-ty/src/next_solver/structural_normalize.rs @@ -47,7 +47,7 @@ impl<'db> At<'_, 'db> { ); fulfill_cx.register_predicate_obligation(self.infcx, obligation); - let errors = fulfill_cx.select_where_possible(self.infcx); + let errors = fulfill_cx.try_evaluate_obligations(self.infcx); if !errors.is_empty() { return Err(errors); } |