mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Use variables in predicates as well
This commit is contained in:
parent
86348f5994
commit
a3d8cffde3
5 changed files with 52 additions and 63 deletions
|
@ -20,7 +20,7 @@ use crate::{
|
|||
traits::InEnvironment,
|
||||
utils::{generics, variant_data, Generics},
|
||||
ApplicationTy, CallableDef, InferTy, IntTy, Mutability, Obligation, Substs, TraitRef, Ty,
|
||||
TypeCtor, TypeWalk, Uncertain, Binders,
|
||||
TypeCtor, Uncertain, Binders,
|
||||
};
|
||||
|
||||
use super::{BindingMode, Expectation, InferenceContext, InferenceDiagnostic, TypeMismatch};
|
||||
|
@ -686,7 +686,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
|
|||
if let TypeCtor::FnDef(def) = a_ty.ctor {
|
||||
let generic_predicates = self.db.generic_predicates(def.into());
|
||||
for predicate in generic_predicates.iter() {
|
||||
let predicate = predicate.clone().subst_type_params(self.db, def.into(), &a_ty.parameters);
|
||||
let predicate = predicate.clone().subst(&a_ty.parameters);
|
||||
if let Some(obligation) = Obligation::from_predicate(predicate) {
|
||||
self.obligations.push(obligation);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue