8136: Introduce QuantifiedWhereClause and DynTy analogous to Chalk r=flodiebold a=flodiebold

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. There's a lot of skipping of the binders; once we're done with the Chalk move, we should review the remaining ones.

8146: Document patch policy r=matklad a=matklad

bors r+
🤖

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2021-03-22 12:08:25 +00:00 committed by GitHub
commit 6f1f91cdcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 215 additions and 113 deletions

View file

@ -11,6 +11,7 @@ use hir_def::{
AssocContainerId, FieldId, Lookup,
};
use hir_expand::name::{name, Name};
use stdx::always;
use syntax::ast::RangeOp;
use crate::{
@ -936,7 +937,9 @@ impl<'a> InferenceContext<'a> {
let def: CallableDefId = from_chalk(self.db, *fn_def);
let generic_predicates = self.db.generic_predicates(def.into());
for predicate in generic_predicates.iter() {
let predicate = predicate.clone().subst(parameters);
let (predicate, binders) =
predicate.clone().subst(parameters).into_value_and_skipped_binders();
always!(binders == 0); // quantified where clauses not yet handled
self.obligations.push(predicate.cast(&Interner));
}
// add obligation for trait implementation, if this is a trait method