Skip to content

Commit f9ba863

Browse files
author
Lukas Markeffsky
committed
remove InferCtxt::clear_caches
1 parent 88b10c1 commit f9ba863

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

compiler/rustc_infer/src/infer/mod.rs

-9
Original file line numberDiff line numberDiff line change
@@ -1521,15 +1521,6 @@ impl<'tcx> InferCtxt<'tcx> {
15211521
closure_kind_ty.to_opt_closure_kind()
15221522
}
15231523

1524-
/// Clears the selection, evaluation, and projection caches. This is useful when
1525-
/// repeatedly attempting to select an `Obligation` while changing only
1526-
/// its `ParamEnv`, since `FulfillmentContext` doesn't use probing.
1527-
pub fn clear_caches(&self) {
1528-
self.selection_cache.clear();
1529-
self.evaluation_cache.clear();
1530-
self.inner.borrow_mut().projection_cache().clear();
1531-
}
1532-
15331524
pub fn universe(&self) -> ty::UniverseIndex {
15341525
self.universe.get()
15351526
}

compiler/rustc_trait_selection/src/traits/auto_trait.rs

-3
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ impl<'tcx> AutoTraitFinder<'tcx> {
152152
with {:?}",
153153
trait_ref, full_env
154154
);
155-
infcx.clear_caches();
156155

157156
// At this point, we already have all of the bounds we need. FulfillmentContext is used
158157
// to store all of the necessary region/lifetime bounds in the InferContext, as well as
@@ -255,8 +254,6 @@ impl<'tcx> AutoTraitFinder<'tcx> {
255254
let dummy_cause = ObligationCause::dummy();
256255

257256
while let Some(pred) = predicates.pop_front() {
258-
infcx.clear_caches();
259-
260257
if !already_visited.insert(pred) {
261258
continue;
262259
}

0 commit comments

Comments
 (0)