From 590c41635952e19c3caae525a827499dbd360049 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 21 Mar 2021 13:22:22 +0100 Subject: Introduce QuantifiedWhereClause and DynTy analogous to Chalk This introduces a bunch of new binders in lots of places, which we have to be careful about, but we had to add them at some point. --- crates/hir_ty/src/traits/chalk.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'crates/hir_ty/src/traits/chalk.rs') diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs index 944145603..4019fdf17 100644 --- a/crates/hir_ty/src/traits/chalk.rs +++ b/crates/hir_ty/src/traits/chalk.rs @@ -238,7 +238,10 @@ impl<'a> chalk_solve::RustIrDatabase for ChalkContext<'a> { }); let bound = OpaqueTyDatumBound { bounds: make_binders( - vec![impl_bound.to_chalk(self.db), proj_bound.to_chalk(self.db)], + vec![ + wrap_in_empty_binders(impl_bound).to_chalk(self.db), + wrap_in_empty_binders(proj_bound).to_chalk(self.db), + ], 1, ), where_clauses: make_binders(vec![], 0), @@ -397,7 +400,6 @@ pub(crate) fn associated_ty_data_query( .iter() .flat_map(|bound| ctx.lower_type_bound(bound, self_ty.clone(), false)) .filter_map(|pred| generic_predicate_to_inline_bound(db, &pred, &self_ty)) - .map(|bound| make_binders(bound.shifted_in(&Interner), 0)) .collect(); let where_clauses = convert_where_clauses(db, type_alias.into(), &bound_vars); @@ -720,3 +722,7 @@ impl From for chalk_ir::ClosureId { chalk_ir::ClosureId(id.as_intern_id()) } } + +fn wrap_in_empty_binders(value: T) -> crate::Binders { + crate::Binders::wrap_empty(value) +} -- cgit v1.2.3