Skip to content

Commit 88e3986

Browse files
Make names more accurate
1 parent ce609db commit 88e3986

File tree

3 files changed

+29
-15
lines changed

3 files changed

+29
-15
lines changed

compiler/rustc_trait_selection/src/solve/assembly/mod.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub(super) trait GoalKind<'tcx>:
5656
/// Consider a clause, which consists of a "assumption" and some "requirements",
5757
/// to satisfy a goal. If the requirements hold, then attempt to satisfy our
5858
/// goal by equating it with the assumption.
59-
fn consider_implied_clause(
59+
fn probe_and_consider_implied_clause(
6060
ecx: &mut EvalCtxt<'_, 'tcx>,
6161
goal: Goal<'tcx, Self>,
6262
assumption: ty::Clause<'tcx>,
@@ -73,15 +73,15 @@ pub(super) trait GoalKind<'tcx>:
7373
/// Consider a clause specifically for a `dyn Trait` self type. This requires
7474
/// additionally checking all of the supertraits and object bounds to hold,
7575
/// since they're not implied by the well-formedness of the object type.
76-
fn consider_object_bound_candidate(
76+
fn probe_and_consider_object_bound_candidate(
7777
ecx: &mut EvalCtxt<'_, 'tcx>,
7878
goal: Goal<'tcx, Self>,
7979
assumption: ty::Clause<'tcx>,
8080
) -> QueryResult<'tcx> {
8181
Self::probe_and_match_goal_against_assumption(ecx, goal, assumption, |ecx| {
8282
let tcx = ecx.tcx();
8383
let ty::Dynamic(bounds, _, _) = *goal.predicate.self_ty().kind() else {
84-
bug!("expected object type in `consider_object_bound_candidate`");
84+
bug!("expected object type in `probe_and_consider_object_bound_candidate`");
8585
};
8686
// FIXME(-Znext-solver=coinductive): Should this be `GoalSource::ImplWhereBound`?
8787
ecx.add_goals(
@@ -557,7 +557,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
557557
candidates: &mut Vec<Candidate<'tcx>>,
558558
) {
559559
for (i, assumption) in goal.param_env.caller_bounds().iter().enumerate() {
560-
match G::consider_implied_clause(self, goal, assumption, []) {
560+
match G::probe_and_consider_implied_clause(self, goal, assumption, []) {
561561
Ok(result) => {
562562
candidates.push(Candidate { source: CandidateSource::ParamEnv(i), result })
563563
}
@@ -648,7 +648,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
648648
for assumption in
649649
self.tcx().item_bounds(alias_ty.def_id).instantiate(self.tcx(), alias_ty.args)
650650
{
651-
match G::consider_implied_clause(self, goal, assumption, []) {
651+
match G::probe_and_consider_implied_clause(self, goal, assumption, []) {
652652
Ok(result) => {
653653
candidates.push(Candidate { source: CandidateSource::AliasBound, result });
654654
}
@@ -728,7 +728,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
728728
}
729729
ty::ExistentialPredicate::Projection(_)
730730
| ty::ExistentialPredicate::AutoTrait(_) => {
731-
match G::consider_object_bound_candidate(
731+
match G::probe_and_consider_object_bound_candidate(
732732
self,
733733
goal,
734734
bound.with_self_ty(tcx, self_ty),
@@ -749,7 +749,11 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
749749
if let Some(principal) = bounds.principal() {
750750
let principal_trait_ref = principal.with_self_ty(tcx, self_ty);
751751
self.walk_vtable(principal_trait_ref, |ecx, assumption, vtable_base, _| {
752-
match G::consider_object_bound_candidate(ecx, goal, assumption.to_predicate(tcx)) {
752+
match G::probe_and_consider_object_bound_candidate(
753+
ecx,
754+
goal,
755+
assumption.to_predicate(tcx),
756+
) {
753757
Ok(result) => candidates.push(Candidate {
754758
source: CandidateSource::BuiltinImpl(BuiltinImplSource::Object {
755759
vtable_base,

compiler/rustc_trait_selection/src/solve/normalizes_to/mod.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,12 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
385385

386386
// A built-in `Fn` impl only holds if the output is sized.
387387
// (FIXME: technically we only need to check this if the type is a fn ptr...)
388-
Self::consider_implied_clause(ecx, goal, pred, [goal.with(tcx, output_is_sized_pred)])
388+
Self::probe_and_consider_implied_clause(
389+
ecx,
390+
goal,
391+
pred,
392+
[goal.with(tcx, output_is_sized_pred)],
393+
)
389394
}
390395

391396
fn consider_builtin_async_fn_trait_candidates(
@@ -461,7 +466,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
461466

462467
// A built-in `AsyncFn` impl only holds if the output is sized.
463468
// (FIXME: technically we only need to check this if the type is a fn ptr...)
464-
Self::consider_implied_clause(
469+
Self::probe_and_consider_implied_clause(
465470
ecx,
466471
goal,
467472
pred,
@@ -623,7 +628,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
623628

624629
let term = args.as_coroutine().return_ty().into();
625630

626-
Self::consider_implied_clause(
631+
Self::probe_and_consider_implied_clause(
627632
ecx,
628633
goal,
629634
ty::ProjectionPredicate {
@@ -654,7 +659,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
654659

655660
let term = args.as_coroutine().yield_ty().into();
656661

657-
Self::consider_implied_clause(
662+
Self::probe_and_consider_implied_clause(
658663
ecx,
659664
goal,
660665
ty::ProjectionPredicate {
@@ -737,7 +742,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
737742
bug!("unexpected associated item `<{self_ty} as Coroutine>::{name}`")
738743
};
739744

740-
Self::consider_implied_clause(
745+
Self::probe_and_consider_implied_clause(
741746
ecx,
742747
goal,
743748
ty::ProjectionPredicate {

compiler/rustc_trait_selection/src/solve/trait_goals.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,12 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
307307
.to_predicate(tcx);
308308
// A built-in `Fn` impl only holds if the output is sized.
309309
// (FIXME: technically we only need to check this if the type is a fn ptr...)
310-
Self::consider_implied_clause(ecx, goal, pred, [goal.with(tcx, output_is_sized_pred)])
310+
Self::probe_and_consider_implied_clause(
311+
ecx,
312+
goal,
313+
pred,
314+
[goal.with(tcx, output_is_sized_pred)],
315+
)
311316
}
312317

313318
fn consider_builtin_async_fn_trait_candidates(
@@ -345,7 +350,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
345350
.to_predicate(tcx);
346351
// A built-in `AsyncFn` impl only holds if the output is sized.
347352
// (FIXME: technically we only need to check this if the type is a fn ptr...)
348-
Self::consider_implied_clause(
353+
Self::probe_and_consider_implied_clause(
349354
ecx,
350355
goal,
351356
pred,
@@ -521,7 +526,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
521526
}
522527

523528
let coroutine = args.as_coroutine();
524-
Self::consider_implied_clause(
529+
Self::probe_and_consider_implied_clause(
525530
ecx,
526531
goal,
527532
ty::TraitRef::new(tcx, goal.predicate.def_id(), [self_ty, coroutine.resume_ty()])

0 commit comments

Comments
 (0)