From 236ac630f6ffc403257d4c77e6187819432956cf Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Mon, 6 Apr 2020 17:24:08 +0200 Subject: Fix Chalk panic Fixes #3865. Basically I forgot to shift 'back' when we got `dyn Trait`s back from Chalk, so after going through Chalk a few times, the panic happened. --- crates/ra_hir_ty/src/traits/chalk.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir_ty/src/traits') diff --git a/crates/ra_hir_ty/src/traits/chalk.rs b/crates/ra_hir_ty/src/traits/chalk.rs index 53ce362ea..1bc0f0713 100644 --- a/crates/ra_hir_ty/src/traits/chalk.rs +++ b/crates/ra_hir_ty/src/traits/chalk.rs @@ -427,7 +427,12 @@ impl ToChalk for GenericPredicate { db: &dyn HirDatabase, where_clause: chalk_ir::QuantifiedWhereClause, ) -> GenericPredicate { - match where_clause.value { + // we don't produce any where clauses with binders and can't currently deal with them + match where_clause + .value + .shifted_out(&Interner) + .expect("unexpected bound vars in where clause") + { chalk_ir::WhereClause::Implemented(tr) => { GenericPredicate::Implemented(from_chalk(db, tr)) } -- cgit v1.2.3