Skip to content

Commit ced971e

Browse files
committed
Fix crash with int vars in canonicalization
1 parent f613c48 commit ced971e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/ra_hir/src/ty/infer/unify.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ where
5656
self.var_stack.pop();
5757
result
5858
} else {
59-
let free_var = InferTy::TypeVar(self.ctx.var_unification_table.find(inner));
59+
let root = self.ctx.var_unification_table.find(inner);
60+
let free_var = match tv {
61+
InferTy::TypeVar(_) => InferTy::TypeVar(root),
62+
InferTy::IntVar(_) => InferTy::IntVar(root),
63+
InferTy::FloatVar(_) => InferTy::FloatVar(root),
64+
};
6065
let position = self.add(free_var);
6166
Ty::Bound(position as u32)
6267
}

0 commit comments

Comments
 (0)