aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer/path.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-04-01 20:45:44 +0100
committerFlorian Diebold <[email protected]>2021-04-01 20:45:44 +0100
commit0e8c4503bf4754f4437d8bd45a110b9d0ec671e0 (patch)
tree0d09bc856ae7b8d5acc2dcc45226ea358dfa6412 /crates/hir_ty/src/infer/path.rs
parent25201b2dad7b4b0d41494e238ebf643ad7ad8cd6 (diff)
Don't recheck obligations if we have learned nothing new
This is just the most trivial check: If no inference variables have been updated, and there are no new obligations, we can just skip trying to solve them again. We could be smarter about it, but this already helps quite a bit, and I don't want to touch this too much before we replace the inference table by Chalk's. Fixes #8263 (well, improves it quite a bit).
Diffstat (limited to 'crates/hir_ty/src/infer/path.rs')
-rw-r--r--crates/hir_ty/src/infer/path.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir_ty/src/infer/path.rs b/crates/hir_ty/src/infer/path.rs
index cefa38509..717738789 100644
--- a/crates/hir_ty/src/infer/path.rs
+++ b/crates/hir_ty/src/infer/path.rs
@@ -258,7 +258,7 @@ impl<'a> InferenceContext<'a> {
258 .push(ty.clone()) 258 .push(ty.clone())
259 .fill(std::iter::repeat_with(|| self.table.new_type_var())) 259 .fill(std::iter::repeat_with(|| self.table.new_type_var()))
260 .build(); 260 .build();
261 self.obligations.push( 261 self.push_obligation(
262 TraitRef { 262 TraitRef {
263 trait_id: to_chalk_trait_id(trait_), 263 trait_id: to_chalk_trait_id(trait_),
264 substitution: trait_substs.clone(), 264 substitution: trait_substs.clone(),