diff options
author | Laurențiu Nicola <[email protected]> | 2021-04-05 13:37:11 +0100 |
---|---|---|
committer | Laurențiu Nicola <[email protected]> | 2021-04-05 13:39:06 +0100 |
commit | 65c2e5194034e4f6f556b96e71ce62bc2a465a35 (patch) | |
tree | 6ff56eca6210f2a87ca9caa8a7485c9ff567dc5e /crates/hir_ty/src/infer | |
parent | d8ee25bb976f50c0c0c8c247ca8bb030d9167bdb (diff) |
Rename TyKind::Unknown to Error
Diffstat (limited to 'crates/hir_ty/src/infer')
-rw-r--r-- | crates/hir_ty/src/infer/path.rs | 4 | ||||
-rw-r--r-- | crates/hir_ty/src/infer/unify.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir_ty/src/infer/path.rs b/crates/hir_ty/src/infer/path.rs index 637341b53..89d78e781 100644 --- a/crates/hir_ty/src/infer/path.rs +++ b/crates/hir_ty/src/infer/path.rs | |||
@@ -142,7 +142,7 @@ impl<'a> InferenceContext<'a> { | |||
142 | remaining_segments_for_ty, | 142 | remaining_segments_for_ty, |
143 | true, | 143 | true, |
144 | ); | 144 | ); |
145 | if let TyKind::Unknown = ty.kind(&Interner) { | 145 | if let TyKind::Error = ty.kind(&Interner) { |
146 | return None; | 146 | return None; |
147 | } | 147 | } |
148 | 148 | ||
@@ -207,7 +207,7 @@ impl<'a> InferenceContext<'a> { | |||
207 | name: &Name, | 207 | name: &Name, |
208 | id: ExprOrPatId, | 208 | id: ExprOrPatId, |
209 | ) -> Option<(ValueNs, Option<Substitution>)> { | 209 | ) -> Option<(ValueNs, Option<Substitution>)> { |
210 | if let TyKind::Unknown = ty.kind(&Interner) { | 210 | if let TyKind::Error = ty.kind(&Interner) { |
211 | return None; | 211 | return None; |
212 | } | 212 | } |
213 | 213 | ||
diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs index b7bc48569..8370f2e1c 100644 --- a/crates/hir_ty/src/infer/unify.rs +++ b/crates/hir_ty/src/infer/unify.rs | |||
@@ -214,7 +214,7 @@ impl TypeVariableTable { | |||
214 | fn fallback_value(&self, iv: InferenceVar, kind: TyVariableKind) -> Ty { | 214 | fn fallback_value(&self, iv: InferenceVar, kind: TyVariableKind) -> Ty { |
215 | match kind { | 215 | match kind { |
216 | _ if self.inner[iv.to_inner().0 as usize].diverging => TyKind::Never, | 216 | _ if self.inner[iv.to_inner().0 as usize].diverging => TyKind::Never, |
217 | TyVariableKind::General => TyKind::Unknown, | 217 | TyVariableKind::General => TyKind::Error, |
218 | TyVariableKind::Integer => TyKind::Scalar(Scalar::Int(IntTy::I32)), | 218 | TyVariableKind::Integer => TyKind::Scalar(Scalar::Int(IntTy::I32)), |
219 | TyVariableKind::Float => TyKind::Scalar(Scalar::Float(FloatTy::F64)), | 219 | TyVariableKind::Float => TyKind::Scalar(Scalar::Float(FloatTy::F64)), |
220 | } | 220 | } |
@@ -327,7 +327,7 @@ impl InferenceTable { | |||
327 | 327 | ||
328 | pub(super) fn unify_inner_trivial(&mut self, ty1: &Ty, ty2: &Ty, depth: usize) -> bool { | 328 | pub(super) fn unify_inner_trivial(&mut self, ty1: &Ty, ty2: &Ty, depth: usize) -> bool { |
329 | match (ty1.kind(&Interner), ty2.kind(&Interner)) { | 329 | match (ty1.kind(&Interner), ty2.kind(&Interner)) { |
330 | (TyKind::Unknown, _) | (_, TyKind::Unknown) => true, | 330 | (TyKind::Error, _) | (_, TyKind::Error) => true, |
331 | 331 | ||
332 | (TyKind::Placeholder(p1), TyKind::Placeholder(p2)) if *p1 == *p2 => true, | 332 | (TyKind::Placeholder(p1), TyKind::Placeholder(p2)) if *p1 == *p2 => true, |
333 | 333 | ||