Skip to content

Commit 467a300

Browse files
committed
more
1 parent 6d10ac7 commit 467a300

File tree

13 files changed

+25
-25
lines changed

13 files changed

+25
-25
lines changed

src/tools/clippy/clippy_lints/src/future_not_send.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
9090
let ocx = ObligationCtxt::new_with_diagnostics(&infcx);
9191
let cause = traits::ObligationCause::misc(span, fn_def_id);
9292
ocx.register_bound(cause, cx.param_env, ret_ty, send_trait);
93-
let send_errors = ocx.select_all_or_error();
93+
let send_errors = ocx.evaluate_registered_obligations_or_error();
9494

9595
// Allow errors that try to prove `Send` for types that "mention" a generic parameter at the "top
9696
// level".

src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ fn is_ty_const_destruct<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, body: &Body<'tcx>
475475

476476
let ocx = ObligationCtxt::new(&infcx);
477477
ocx.register_obligations(impl_src.nested_obligations());
478-
ocx.select_all_or_error().is_empty()
478+
ocx.evaluate_registered_obligations_or_error().is_empty()
479479
}
480480

481481
!ty.needs_drop(tcx, ConstCx::new(tcx, body).typing_env)

src/tools/rust-analyzer/crates/hir-ty/src/autoderef.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ fn structurally_normalize_ty<'db>(
304304
// evaluate/fulfill mismatches, but that's not a reason for an ICE.
305305
return None;
306306
};
307-
let errors = ocx.select_where_possible();
307+
let errors = ocx.try_evaluate_registered_obligations();
308308
if !errors.is_empty() {
309309
unreachable!();
310310
}

src/tools/rust-analyzer/crates/hir-ty/src/infer/coerce.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl<'a, 'b, 'db> Coerce<'a, 'b, 'db> {
160160
Ok(InferOk { value, obligations }) => {
161161
let mut ocx = ObligationCtxt::new(this.infer_ctxt());
162162
ocx.register_obligations(obligations);
163-
if ocx.select_where_possible().is_empty() {
163+
if ocx.try_evaluate_registered_obligations().is_empty() {
164164
Ok(InferOk { value, obligations: ocx.into_pending_obligations() })
165165
} else {
166166
Err(TypeError::Mismatch)
@@ -744,7 +744,7 @@ impl<'a, 'b, 'db> Coerce<'a, 'b, 'db> {
744744
Some(PredicateKind::AliasRelate(..)) => {
745745
let mut ocx = ObligationCtxt::new(self.infer_ctxt());
746746
ocx.register_obligation(obligation);
747-
if !ocx.select_where_possible().is_empty() {
747+
if !ocx.try_evaluate_registered_obligations().is_empty() {
748748
return Err(TypeError::Mismatch);
749749
}
750750
coercion.obligations.extend(ocx.into_pending_obligations());
@@ -1116,7 +1116,7 @@ impl<'db> InferenceContext<'db> {
11161116
let mut ocx = ObligationCtxt::new(&table.infer_ctxt);
11171117
let value =
11181118
ocx.lub(&ObligationCause::new(), table.param_env, prev_ty, new_ty)?;
1119-
if ocx.select_where_possible().is_empty() {
1119+
if ocx.try_evaluate_registered_obligations().is_empty() {
11201120
Ok(InferOk { value, obligations: ocx.into_pending_obligations() })
11211121
} else {
11221122
Err(TypeError::Mismatch)

src/tools/rust-analyzer/crates/hir-ty/src/infer/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2136,7 +2136,7 @@ impl<'db> InferenceContext<'db> {
21362136
expected_output.to_nextsolver(interner),
21372137
formal_output,
21382138
)?;
2139-
if !ocx.select_where_possible().is_empty() {
2139+
if !ocx.try_evaluate_registered_obligations().is_empty() {
21402140
return Err(crate::next_solver::TypeError::Mismatch);
21412141
}
21422142

src/tools/rust-analyzer/crates/hir-ty/src/infer/unify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ impl<'db> InferenceTable<'db> {
938938
}
939939

940940
pub(crate) fn select_obligations_where_possible(&mut self) {
941-
self.fulfillment_cx.select_where_possible(&self.infer_ctxt);
941+
self.fulfillment_cx.try_evaluate_registered_obligations(&self.infer_ctxt);
942942
}
943943

944944
pub(super) fn register_predicate(

src/tools/rust-analyzer/crates/hir-ty/src/method_resolution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1772,7 +1772,7 @@ fn is_valid_trait_method_candidate(
17721772
ctxt.register_predicate_obligation(&table.infer_ctxt, pred);
17731773
}
17741774
// FIXME: Are we doing this correctly? Probably better to follow rustc more closely.
1775-
check_that!(ctxt.select_where_possible(&table.infer_ctxt).is_empty());
1775+
check_that!(ctxt.try_evaluate_registered_obligations(&table.infer_ctxt).is_empty());
17761776
}
17771777

17781778
check_that!(table.unify(receiver_ty, &expected_receiver));

src/tools/rust-analyzer/crates/hir-ty/src/next_solver/fulfill.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct ObligationStorage<'db> {
5454
/// Obligations which resulted in an overflow in fulfillment itself.
5555
///
5656
/// We cannot eagerly return these as error so we instead store them here
57-
/// to avoid recomputing them each time `select_where_possible` is called.
57+
/// to avoid recomputing them each time `try_evaluate_registered_obligations` is called.
5858
/// This also allows us to return the correct `FulfillmentError` for them.
5959
overflowed: Vec<PredicateObligation<'db>>,
6060
pending: PendingObligations<'db>,
@@ -95,7 +95,7 @@ impl<'db> ObligationStorage<'db> {
9595
// IMPORTANT: we must not use solve any inference variables in the obligations
9696
// as this is all happening inside of a probe. We use a probe to make sure
9797
// we get all obligations involved in the overflow. We pretty much check: if
98-
// we were to do another step of `select_where_possible`, which goals would
98+
// we were to do another step of `try_evaluate_registered_obligations`, which goals would
9999
// change.
100100
// FIXME: <https://github.com/Gankra/thin-vec/pull/66> is merged, this can be removed.
101101
self.overflowed.extend(
@@ -131,7 +131,7 @@ impl<'db> FulfillmentCtxt<'db> {
131131
infcx: &InferCtxt<'db>,
132132
obligation: PredicateObligation<'db>,
133133
) {
134-
// FIXME: See the comment in `select_where_possible()`.
134+
// FIXME: See the comment in `try_evaluate_registered_obligations()`.
135135
// assert_eq!(self.usable_in_snapshot, infcx.num_open_snapshots());
136136
self.obligations.register(obligation, None);
137137
}
@@ -141,7 +141,7 @@ impl<'db> FulfillmentCtxt<'db> {
141141
infcx: &InferCtxt<'db>,
142142
obligations: impl IntoIterator<Item = PredicateObligation<'db>>,
143143
) {
144-
// FIXME: See the comment in `select_where_possible()`.
144+
// FIXME: See the comment in `try_evaluate_registered_obligations()`.
145145
// assert_eq!(self.usable_in_snapshot, infcx.num_open_snapshots());
146146
obligations.into_iter().for_each(|obligation| self.obligations.register(obligation, None));
147147
}
@@ -158,7 +158,7 @@ impl<'db> FulfillmentCtxt<'db> {
158158
.collect()
159159
}
160160

161-
pub(crate) fn select_where_possible(
161+
pub(crate) fn try_evaluate_registered_obligations(
162162
&mut self,
163163
infcx: &InferCtxt<'db>,
164164
) -> Vec<NextSolverError<'db>> {
@@ -223,11 +223,11 @@ impl<'db> FulfillmentCtxt<'db> {
223223
errors
224224
}
225225

226-
pub(crate) fn select_all_or_error(
226+
pub(crate) fn evaluate_registered_obligations_or_error(
227227
&mut self,
228228
infcx: &InferCtxt<'db>,
229229
) -> Vec<NextSolverError<'db>> {
230-
let errors = self.select_where_possible(infcx);
230+
let errors = self.try_evaluate_registered_obligations(infcx);
231231
if !errors.is_empty() {
232232
return errors;
233233
}

src/tools/rust-analyzer/crates/hir-ty/src/next_solver/inspect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<'db> NormalizesToTermHack<'db> {
9292
let mut ocx = ObligationCtxt::new(infcx);
9393
ocx.eq(&ObligationCause::dummy(), param_env, self.term, self.unconstrained_term)?;
9494
f(&mut ocx);
95-
let errors = ocx.select_all_or_error();
95+
let errors = ocx.evaluate_registered_obligations_or_error();
9696
if errors.is_empty() {
9797
Ok(Certainty::Yes)
9898
} else if errors.iter().all(|e| !matches!(e, NextSolverError::TrueError(_))) {

src/tools/rust-analyzer/crates/hir-ty/src/next_solver/normalize.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ where
7777
stalled_coroutine_goals: vec![],
7878
};
7979
let value = value.try_fold_with(&mut folder)?;
80-
let errors = folder.fulfill_cx.select_all_or_error(at.infcx);
80+
let errors = folder.fulfill_cx.evaluate_registered_obligations_or_error(at.infcx);
8181
if errors.is_empty() { Ok((value, folder.stalled_coroutine_goals)) } else { Err(errors) }
8282
}
8383

@@ -138,7 +138,7 @@ impl<'db> NormalizationFolder<'_, 'db> {
138138
fn select_all_and_stall_coroutine_predicates(
139139
&mut self,
140140
) -> Result<(), Vec<NextSolverError<'db>>> {
141-
let errors = self.fulfill_cx.select_where_possible(self.at.infcx);
141+
let errors = self.fulfill_cx.try_evaluate_registered_obligations(self.at.infcx);
142142
if !errors.is_empty() {
143143
return Err(errors);
144144
}

0 commit comments

Comments
 (0)