diff options
author | Florian Diebold <[email protected]> | 2021-03-21 16:40:14 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-03-21 17:01:14 +0000 |
commit | 1d5c4a77fb33cab7bf8f9d2edc6dd26b09ef65f3 (patch) | |
tree | 9cc37c708ec3c2df8adbc1e96204c7a7e2e3ca65 /crates/hir_ty/src/infer | |
parent | 590c41635952e19c3caae525a827499dbd360049 (diff) |
Use QuantifiedWhereClause in generic_predicates as well
Still far too much binder skipping going on; I find it hard to imagine
this is all correct, but the tests pass.
Diffstat (limited to 'crates/hir_ty/src/infer')
-rw-r--r-- | crates/hir_ty/src/infer/expr.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index 79bbc5dab..17849d552 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs | |||
@@ -11,6 +11,7 @@ use hir_def::{ | |||
11 | AssocContainerId, FieldId, Lookup, | 11 | AssocContainerId, FieldId, Lookup, |
12 | }; | 12 | }; |
13 | use hir_expand::name::{name, Name}; | 13 | use hir_expand::name::{name, Name}; |
14 | use stdx::always; | ||
14 | use syntax::ast::RangeOp; | 15 | use syntax::ast::RangeOp; |
15 | 16 | ||
16 | use crate::{ | 17 | use crate::{ |
@@ -936,7 +937,9 @@ impl<'a> InferenceContext<'a> { | |||
936 | let def: CallableDefId = from_chalk(self.db, *fn_def); | 937 | let def: CallableDefId = from_chalk(self.db, *fn_def); |
937 | let generic_predicates = self.db.generic_predicates(def.into()); | 938 | let generic_predicates = self.db.generic_predicates(def.into()); |
938 | for predicate in generic_predicates.iter() { | 939 | for predicate in generic_predicates.iter() { |
939 | let predicate = predicate.clone().subst(parameters); | 940 | let (predicate, binders) = |
941 | predicate.clone().subst(parameters).into_value_and_skipped_binders(); | ||
942 | always!(binders == 0); // quantified where clauses not yet handled | ||
940 | self.obligations.push(predicate.cast(&Interner)); | 943 | self.obligations.push(predicate.cast(&Interner)); |
941 | } | 944 | } |
942 | // add obligation for trait implementation, if this is a trait method | 945 | // add obligation for trait implementation, if this is a trait method |