diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-16 12:03:42 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-16 12:03:42 +0000 |
commit | 77d27c67c1dadce4abe7a6a97c0b73eaa3706e60 (patch) | |
tree | 9dd19eb756f74a875a35afb5b68296b8934c631d /crates/ra_hir_ty/src/infer | |
parent | a15c8739b9a6da223e1f3a6ff6aa868913c0dbf4 (diff) | |
parent | e14e7ffa34bf9a458681fe7490ac2d51b02ff908 (diff) |
Merge #3165
3165: Fix coercion of &T to itself r=matklad a=flodiebold
The autoderef coercion logic did not handle matching placeholders. This led to
some type mismatches.
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/infer')
-rw-r--r-- | crates/ra_hir_ty/src/infer/unify.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/infer/unify.rs b/crates/ra_hir_ty/src/infer/unify.rs index fe05642ae..1dc842f40 100644 --- a/crates/ra_hir_ty/src/infer/unify.rs +++ b/crates/ra_hir_ty/src/infer/unify.rs | |||
@@ -249,6 +249,8 @@ impl InferenceTable { | |||
249 | match (ty1, ty2) { | 249 | match (ty1, ty2) { |
250 | (Ty::Unknown, _) | (_, Ty::Unknown) => true, | 250 | (Ty::Unknown, _) | (_, Ty::Unknown) => true, |
251 | 251 | ||
252 | (Ty::Placeholder(p1), Ty::Placeholder(p2)) if *p1 == *p2 => true, | ||
253 | |||
252 | (Ty::Infer(InferTy::TypeVar(tv1)), Ty::Infer(InferTy::TypeVar(tv2))) | 254 | (Ty::Infer(InferTy::TypeVar(tv1)), Ty::Infer(InferTy::TypeVar(tv2))) |
253 | | (Ty::Infer(InferTy::IntVar(tv1)), Ty::Infer(InferTy::IntVar(tv2))) | 255 | | (Ty::Infer(InferTy::IntVar(tv1)), Ty::Infer(InferTy::IntVar(tv2))) |
254 | | (Ty::Infer(InferTy::FloatVar(tv1)), Ty::Infer(InferTy::FloatVar(tv2))) | 256 | | (Ty::Infer(InferTy::FloatVar(tv1)), Ty::Infer(InferTy::FloatVar(tv2))) |