aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/traits
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/traits')
-rw-r--r--crates/hir_ty/src/traits/chalk.rs8
-rw-r--r--crates/hir_ty/src/traits/chalk/mapping.rs7
2 files changed, 2 insertions, 13 deletions
diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs
index 4144035cd..734679414 100644
--- a/crates/hir_ty/src/traits/chalk.rs
+++ b/crates/hir_ty/src/traits/chalk.rs
@@ -187,13 +187,7 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> {
187 let data = &datas.value.impl_traits[idx as usize]; 187 let data = &datas.value.impl_traits[idx as usize];
188 let bound = OpaqueTyDatumBound { 188 let bound = OpaqueTyDatumBound {
189 bounds: make_binders( 189 bounds: make_binders(
190 data.bounds 190 data.bounds.value.iter().cloned().map(|b| b.to_chalk(self.db)).collect(),
191 .value
192 .iter()
193 .cloned()
194 .filter(|b| !b.is_error())
195 .map(|b| b.to_chalk(self.db))
196 .collect(),
197 1, 191 1,
198 ), 192 ),
199 where_clauses: make_binders(vec![], 0), 193 where_clauses: make_binders(vec![], 0),
diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs
index 5756e9754..7841c216c 100644
--- a/crates/hir_ty/src/traits/chalk/mapping.rs
+++ b/crates/hir_ty/src/traits/chalk/mapping.rs
@@ -98,7 +98,7 @@ impl ToChalk for Ty {
98 TyKind::Dyn(predicates) => { 98 TyKind::Dyn(predicates) => {
99 let where_clauses = chalk_ir::QuantifiedWhereClauses::from_iter( 99 let where_clauses = chalk_ir::QuantifiedWhereClauses::from_iter(
100 &Interner, 100 &Interner,
101 predicates.iter().filter(|p| !p.is_error()).cloned().map(|p| p.to_chalk(db)), 101 predicates.iter().cloned().map(|p| p.to_chalk(db)),
102 ); 102 );
103 let bounded_ty = chalk_ir::DynTy { 103 let bounded_ty = chalk_ir::DynTy {
104 bounds: make_binders(where_clauses, 1), 104 bounds: make_binders(where_clauses, 1),
@@ -318,7 +318,6 @@ impl ToChalk for WhereClause {
318 chalk_ir::WhereClause::AliasEq(alias_eq.to_chalk(db).shifted_in(&Interner)), 318 chalk_ir::WhereClause::AliasEq(alias_eq.to_chalk(db).shifted_in(&Interner)),
319 0, 319 0,
320 ), 320 ),
321 WhereClause::Error => panic!("tried passing GenericPredicate::Error to Chalk"),
322 } 321 }
323 } 322 }
324 323
@@ -521,10 +520,6 @@ pub(super) fn convert_where_clauses(
521 let generic_predicates = db.generic_predicates(def); 520 let generic_predicates = db.generic_predicates(def);
522 let mut result = Vec::with_capacity(generic_predicates.len()); 521 let mut result = Vec::with_capacity(generic_predicates.len());
523 for pred in generic_predicates.iter() { 522 for pred in generic_predicates.iter() {
524 if pred.value.is_error() {
525 // skip errored predicates completely
526 continue;
527 }
528 result.push(pred.clone().subst(substs).to_chalk(db)); 523 result.push(pred.clone().subst(substs).to_chalk(db));
529 } 524 }
530 result 525 result