aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/traits
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/traits
parentd8ee25bb976f50c0c0c8c247ca8bb030d9167bdb (diff)
Rename TyKind::Unknown to Error
Diffstat (limited to 'crates/hir_ty/src/traits')
-rw-r--r--crates/hir_ty/src/traits/chalk.rs2
-rw-r--r--crates/hir_ty/src/traits/chalk/mapping.rs6
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs
index 541e6082f..b7388b98c 100644
--- a/crates/hir_ty/src/traits/chalk.rs
+++ b/crates/hir_ty/src/traits/chalk.rs
@@ -265,7 +265,7 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> {
265 265
266 fn hidden_opaque_type(&self, _id: chalk_ir::OpaqueTyId<Interner>) -> chalk_ir::Ty<Interner> { 266 fn hidden_opaque_type(&self, _id: chalk_ir::OpaqueTyId<Interner>) -> chalk_ir::Ty<Interner> {
267 // FIXME: actually provide the hidden type; it is relevant for auto traits 267 // FIXME: actually provide the hidden type; it is relevant for auto traits
268 TyKind::Unknown.intern(&Interner).to_chalk(self.db) 268 TyKind::Error.intern(&Interner).to_chalk(self.db)
269 } 269 }
270 270
271 fn is_object_safe(&self, _trait_id: chalk_ir::TraitId<Interner>) -> bool { 271 fn is_object_safe(&self, _trait_id: chalk_ir::TraitId<Interner>) -> bool {
diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs
index 5e4f97a46..c5654f17b 100644
--- a/crates/hir_ty/src/traits/chalk/mapping.rs
+++ b/crates/hir_ty/src/traits/chalk/mapping.rs
@@ -103,12 +103,12 @@ impl ToChalk for Ty {
103 }; 103 };
104 chalk_ir::TyKind::Dyn(bounded_ty).intern(&Interner) 104 chalk_ir::TyKind::Dyn(bounded_ty).intern(&Interner)
105 } 105 }
106 TyKind::Unknown => chalk_ir::TyKind::Error.intern(&Interner), 106 TyKind::Error => chalk_ir::TyKind::Error.intern(&Interner),
107 } 107 }
108 } 108 }
109 fn from_chalk(db: &dyn HirDatabase, chalk: chalk_ir::Ty<Interner>) -> Self { 109 fn from_chalk(db: &dyn HirDatabase, chalk: chalk_ir::Ty<Interner>) -> Self {
110 match chalk.data(&Interner).kind.clone() { 110 match chalk.data(&Interner).kind.clone() {
111 chalk_ir::TyKind::Error => TyKind::Unknown, 111 chalk_ir::TyKind::Error => TyKind::Error,
112 chalk_ir::TyKind::Array(ty, _size) => TyKind::Array(from_chalk(db, ty)), 112 chalk_ir::TyKind::Array(ty, _size) => TyKind::Array(from_chalk(db, ty)),
113 chalk_ir::TyKind::Placeholder(idx) => TyKind::Placeholder(idx), 113 chalk_ir::TyKind::Placeholder(idx) => TyKind::Placeholder(idx),
114 chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Projection(proj)) => { 114 chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Projection(proj)) => {
@@ -138,7 +138,7 @@ impl ToChalk for Ty {
138 TyKind::Function(FnPointer { num_args: (substs.len(&Interner) - 1), sig, substs }) 138 TyKind::Function(FnPointer { num_args: (substs.len(&Interner) - 1), sig, substs })
139 } 139 }
140 chalk_ir::TyKind::BoundVar(idx) => TyKind::BoundVar(idx), 140 chalk_ir::TyKind::BoundVar(idx) => TyKind::BoundVar(idx),
141 chalk_ir::TyKind::InferenceVar(_iv, _kind) => TyKind::Unknown, 141 chalk_ir::TyKind::InferenceVar(_iv, _kind) => TyKind::Error,
142 chalk_ir::TyKind::Dyn(where_clauses) => { 142 chalk_ir::TyKind::Dyn(where_clauses) => {
143 assert_eq!(where_clauses.bounds.binders.len(&Interner), 1); 143 assert_eq!(where_clauses.bounds.binders.len(&Interner), 1);
144 let bounds = where_clauses 144 let bounds = where_clauses