aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-05-15 18:28:58 +0100
committerFlorian Diebold <[email protected]>2021-05-21 16:48:34 +0100
commit212f0477f29ec27a3981a916de432fc9ef872ff3 (patch)
tree5a8c5c7391a1fda399c909180b969abae2212435 /crates/hir_ty/src/infer.rs
parent32fc944263ae0b30eba130fbcf28f4eb5578fdb3 (diff)
Make diverging type variables work again
Chalk doesn't know about the `diverging` flag, so we need to instead propagate it before fully resolving the variables.
Diffstat (limited to 'crates/hir_ty/src/infer.rs')
-rw-r--r--crates/hir_ty/src/infer.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/hir_ty/src/infer.rs b/crates/hir_ty/src/infer.rs
index f3cccca68..7898740be 100644
--- a/crates/hir_ty/src/infer.rs
+++ b/crates/hir_ty/src/infer.rs
@@ -284,6 +284,9 @@ impl<'a> InferenceContext<'a> {
284 284
285 fn resolve_all(mut self) -> InferenceResult { 285 fn resolve_all(mut self) -> InferenceResult {
286 // FIXME resolve obligations as well (use Guidance if necessary) 286 // FIXME resolve obligations as well (use Guidance if necessary)
287
288 // make sure diverging type variables are marked as such
289 self.table.propagate_diverging_flag();
287 let mut result = std::mem::take(&mut self.result); 290 let mut result = std::mem::take(&mut self.result);
288 for ty in result.type_of_expr.values_mut() { 291 for ty in result.type_of_expr.values_mut() {
289 let resolved = self.table.resolve_ty_completely(ty.clone()); 292 let resolved = self.table.resolve_ty_completely(ty.clone());