From 8e7e405f6ab0c1ee10bfdd3d55a97628fe4cd6dd Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 20 Mar 2021 10:51:00 +0100 Subject: Remove WhereClause::Error Chalk doesn't have it, and judging from the removed code, it wasn't useful anyway. --- crates/hir_ty/src/traits/chalk.rs | 8 +------- crates/hir_ty/src/traits/chalk/mapping.rs | 7 +------ 2 files changed, 2 insertions(+), 13 deletions(-) (limited to 'crates/hir_ty/src/traits') 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 for ChalkContext<'a> { let data = &datas.value.impl_traits[idx as usize]; let bound = OpaqueTyDatumBound { bounds: make_binders( - data.bounds - .value - .iter() - .cloned() - .filter(|b| !b.is_error()) - .map(|b| b.to_chalk(self.db)) - .collect(), + data.bounds.value.iter().cloned().map(|b| b.to_chalk(self.db)).collect(), 1, ), 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 { TyKind::Dyn(predicates) => { let where_clauses = chalk_ir::QuantifiedWhereClauses::from_iter( &Interner, - predicates.iter().filter(|p| !p.is_error()).cloned().map(|p| p.to_chalk(db)), + predicates.iter().cloned().map(|p| p.to_chalk(db)), ); let bounded_ty = chalk_ir::DynTy { bounds: make_binders(where_clauses, 1), @@ -318,7 +318,6 @@ impl ToChalk for WhereClause { chalk_ir::WhereClause::AliasEq(alias_eq.to_chalk(db).shifted_in(&Interner)), 0, ), - WhereClause::Error => panic!("tried passing GenericPredicate::Error to Chalk"), } } @@ -521,10 +520,6 @@ pub(super) fn convert_where_clauses( let generic_predicates = db.generic_predicates(def); let mut result = Vec::with_capacity(generic_predicates.len()); for pred in generic_predicates.iter() { - if pred.value.is_error() { - // skip errored predicates completely - continue; - } result.push(pred.clone().subst(substs).to_chalk(db)); } result -- cgit v1.2.3