aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer/coerce.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-04-03 12:09:43 +0100
committerGitHub <[email protected]>2021-04-03 12:09:43 +0100
commit2f87ee7f3f9c1efd726774511c9ce02caef73872 (patch)
treeaba0fc8a8b9dcd3456f47ae5cd28fa672a7a6911 /crates/hir_ty/src/infer/coerce.rs
parent8289b96216b5d4ddd0b6cf9feccb7af574d022a8 (diff)
parentc551604b5a0b74a43f5efe567bcbd979daa2f3cc (diff)
Merge #8310
8310: Rename Ty::interned to Ty::kind r=flodiebold a=flodiebold ... since that's the actual method on Chalk side that matches the signature. Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/infer/coerce.rs')
-rw-r--r--crates/hir_ty/src/infer/coerce.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir_ty/src/infer/coerce.rs b/crates/hir_ty/src/infer/coerce.rs
index 8f7322b36..d887e21a2 100644
--- a/crates/hir_ty/src/infer/coerce.rs
+++ b/crates/hir_ty/src/infer/coerce.rs
@@ -36,7 +36,7 @@ impl<'a> InferenceContext<'a> {
36 ty1.clone() 36 ty1.clone()
37 } else { 37 } else {
38 if let (TyKind::FnDef(..), TyKind::FnDef(..)) = 38 if let (TyKind::FnDef(..), TyKind::FnDef(..)) =
39 (ty1.interned(&Interner), ty2.interned(&Interner)) 39 (ty1.kind(&Interner), ty2.kind(&Interner))
40 { 40 {
41 cov_mark::hit!(coerce_fn_reification); 41 cov_mark::hit!(coerce_fn_reification);
42 // Special case: two function types. Try to coerce both to 42 // Special case: two function types. Try to coerce both to
@@ -55,7 +55,7 @@ impl<'a> InferenceContext<'a> {
55 } 55 }
56 56
57 fn coerce_inner(&mut self, mut from_ty: Ty, to_ty: &Ty) -> bool { 57 fn coerce_inner(&mut self, mut from_ty: Ty, to_ty: &Ty) -> bool {
58 match (from_ty.interned(&Interner), to_ty.interned(&Interner)) { 58 match (from_ty.kind(&Interner), to_ty.kind(&Interner)) {
59 // Never type will make type variable to fallback to Never Type instead of Unknown. 59 // Never type will make type variable to fallback to Never Type instead of Unknown.
60 (TyKind::Never, TyKind::InferenceVar(tv, TyVariableKind::General)) => { 60 (TyKind::Never, TyKind::InferenceVar(tv, TyVariableKind::General)) => {
61 self.table.type_variable_table.set_diverging(*tv, true); 61 self.table.type_variable_table.set_diverging(*tv, true);
@@ -73,7 +73,7 @@ impl<'a> InferenceContext<'a> {
73 } 73 }
74 74
75 // Pointer weakening and function to pointer 75 // Pointer weakening and function to pointer
76 match (from_ty.interned_mut(), to_ty.interned(&Interner)) { 76 match (from_ty.interned_mut(), to_ty.kind(&Interner)) {
77 // `*mut T` -> `*const T` 77 // `*mut T` -> `*const T`
78 // `&mut T` -> `&T` 78 // `&mut T` -> `&T`
79 (TyKind::Raw(m1, ..), TyKind::Raw(m2 @ Mutability::Not, ..)) 79 (TyKind::Raw(m1, ..), TyKind::Raw(m2 @ Mutability::Not, ..))
@@ -111,7 +111,7 @@ impl<'a> InferenceContext<'a> {
111 } 111 }
112 112
113 // Auto Deref if cannot coerce 113 // Auto Deref if cannot coerce
114 match (from_ty.interned(&Interner), to_ty.interned(&Interner)) { 114 match (from_ty.kind(&Interner), to_ty.kind(&Interner)) {
115 // FIXME: DerefMut 115 // FIXME: DerefMut
116 (TyKind::Ref(_, st1), TyKind::Ref(_, st2)) => self.unify_autoderef_behind_ref(st1, st2), 116 (TyKind::Ref(_, st1), TyKind::Ref(_, st2)) => self.unify_autoderef_behind_ref(st1, st2),
117 117