diff options
author | Florian Diebold <[email protected]> | 2021-03-21 12:22:22 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-03-21 17:01:14 +0000 |
commit | 590c41635952e19c3caae525a827499dbd360049 (patch) | |
tree | eca7c162975ef901b723d255512e61c047e838b8 /crates/hir_ty/src/traits/chalk.rs | |
parent | 35868c4f7dc479dd5f731a2785ec6a203046ea9c (diff) |
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.
Diffstat (limited to 'crates/hir_ty/src/traits/chalk.rs')
-rw-r--r-- | crates/hir_ty/src/traits/chalk.rs | 10 |
1 files changed, 8 insertions, 2 deletions
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<Interner> for ChalkContext<'a> { | |||
238 | }); | 238 | }); |
239 | let bound = OpaqueTyDatumBound { | 239 | let bound = OpaqueTyDatumBound { |
240 | bounds: make_binders( | 240 | bounds: make_binders( |
241 | vec![impl_bound.to_chalk(self.db), proj_bound.to_chalk(self.db)], | 241 | vec![ |
242 | wrap_in_empty_binders(impl_bound).to_chalk(self.db), | ||
243 | wrap_in_empty_binders(proj_bound).to_chalk(self.db), | ||
244 | ], | ||
242 | 1, | 245 | 1, |
243 | ), | 246 | ), |
244 | where_clauses: make_binders(vec![], 0), | 247 | where_clauses: make_binders(vec![], 0), |
@@ -397,7 +400,6 @@ pub(crate) fn associated_ty_data_query( | |||
397 | .iter() | 400 | .iter() |
398 | .flat_map(|bound| ctx.lower_type_bound(bound, self_ty.clone(), false)) | 401 | .flat_map(|bound| ctx.lower_type_bound(bound, self_ty.clone(), false)) |
399 | .filter_map(|pred| generic_predicate_to_inline_bound(db, &pred, &self_ty)) | 402 | .filter_map(|pred| generic_predicate_to_inline_bound(db, &pred, &self_ty)) |
400 | .map(|bound| make_binders(bound.shifted_in(&Interner), 0)) | ||
401 | .collect(); | 403 | .collect(); |
402 | 404 | ||
403 | let where_clauses = convert_where_clauses(db, type_alias.into(), &bound_vars); | 405 | let where_clauses = convert_where_clauses(db, type_alias.into(), &bound_vars); |
@@ -720,3 +722,7 @@ impl From<crate::db::InternedClosureId> for chalk_ir::ClosureId<Interner> { | |||
720 | chalk_ir::ClosureId(id.as_intern_id()) | 722 | chalk_ir::ClosureId(id.as_intern_id()) |
721 | } | 723 | } |
722 | } | 724 | } |
725 | |||
726 | fn wrap_in_empty_binders<T: crate::TypeWalk>(value: T) -> crate::Binders<T> { | ||
727 | crate::Binders::wrap_empty(value) | ||
728 | } | ||