aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer.rs
diff options
context:
space:
mode:
authorLaurenČ›iu Nicola <[email protected]>2021-04-05 13:37:11 +0100
committerLaurenČ›iu Nicola <[email protected]>2021-04-05 13:39:06 +0100
commit65c2e5194034e4f6f556b96e71ce62bc2a465a35 (patch)
tree6ff56eca6210f2a87ca9caa8a7485c9ff567dc5e /crates/hir_ty/src/infer.rs
parentd8ee25bb976f50c0c0c8c247ca8bb030d9167bdb (diff)
Rename TyKind::Unknown to Error
Diffstat (limited to 'crates/hir_ty/src/infer.rs')
-rw-r--r--crates/hir_ty/src/infer.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/hir_ty/src/infer.rs b/crates/hir_ty/src/infer.rs
index bb885db35..6151e48cd 100644
--- a/crates/hir_ty/src/infer.rs
+++ b/crates/hir_ty/src/infer.rs
@@ -120,7 +120,7 @@ struct InternedStandardTypes {
120 120
121impl Default for InternedStandardTypes { 121impl Default for InternedStandardTypes {
122 fn default() -> Self { 122 fn default() -> Self {
123 InternedStandardTypes { unknown: TyKind::Unknown.intern(&Interner) } 123 InternedStandardTypes { unknown: TyKind::Error.intern(&Interner) }
124 } 124 }
125} 125}
126 126
@@ -247,7 +247,7 @@ impl<'a> InferenceContext<'a> {
247 table: unify::InferenceTable::new(), 247 table: unify::InferenceTable::new(),
248 obligations: Vec::default(), 248 obligations: Vec::default(),
249 last_obligations_check: None, 249 last_obligations_check: None,
250 return_ty: TyKind::Unknown.intern(&Interner), // set in collect_fn_signature 250 return_ty: TyKind::Error.intern(&Interner), // set in collect_fn_signature
251 trait_env: owner 251 trait_env: owner
252 .as_generic_def_id() 252 .as_generic_def_id()
253 .map_or_else(Default::default, |d| db.trait_environment(d)), 253 .map_or_else(Default::default, |d| db.trait_environment(d)),
@@ -261,7 +261,7 @@ impl<'a> InferenceContext<'a> {
261 } 261 }
262 262
263 fn err_ty(&self) -> Ty { 263 fn err_ty(&self) -> Ty {
264 TyKind::Unknown.intern(&Interner) 264 TyKind::Error.intern(&Interner)
265 } 265 }
266 266
267 fn resolve_all(mut self) -> InferenceResult { 267 fn resolve_all(mut self) -> InferenceResult {
@@ -326,7 +326,7 @@ impl<'a> InferenceContext<'a> {
326 /// Replaces Ty::Unknown by a new type var, so we can maybe still infer it. 326 /// Replaces Ty::Unknown by a new type var, so we can maybe still infer it.
327 fn insert_type_vars_shallow(&mut self, ty: Ty) -> Ty { 327 fn insert_type_vars_shallow(&mut self, ty: Ty) -> Ty {
328 match ty.kind(&Interner) { 328 match ty.kind(&Interner) {
329 TyKind::Unknown => self.table.new_type_var(), 329 TyKind::Error => self.table.new_type_var(),
330 _ => ty, 330 _ => ty,
331 } 331 }
332 } 332 }
@@ -542,7 +542,7 @@ impl<'a> InferenceContext<'a> {
542 result 542 result
543 } else { 543 } else {
544 // FIXME diagnostic 544 // FIXME diagnostic
545 (TyKind::Unknown.intern(&Interner), None) 545 (TyKind::Error.intern(&Interner), None)
546 } 546 }
547 } 547 }
548 548
@@ -755,7 +755,7 @@ impl Expectation {
755 fn none() -> Self { 755 fn none() -> Self {
756 Expectation { 756 Expectation {
757 // FIXME 757 // FIXME
758 ty: TyKind::Unknown.intern(&Interner), 758 ty: TyKind::Error.intern(&Interner),
759 rvalue_hint: false, 759 rvalue_hint: false,
760 } 760 }
761 } 761 }
@@ -763,7 +763,7 @@ impl Expectation {
763 fn coercion_target(&self) -> Ty { 763 fn coercion_target(&self) -> Ty {
764 if self.rvalue_hint { 764 if self.rvalue_hint {
765 // FIXME 765 // FIXME
766 TyKind::Unknown.intern(&Interner) 766 TyKind::Error.intern(&Interner)
767 } else { 767 } else {
768 self.ty.clone() 768 self.ty.clone()
769 } 769 }